The cities also announced a $500,000 settlement with Lyft. Confirming the settlement, Lyft said it "demonstrates our shared commitment to consumers and innovation."
The cities have accused both car service providers of unlawful business practices, including their methods of screening drivers and charging passengers.
Read MoreWhy Uber at $40 billion makes no sense
Another riding service—Sidecar—is still under investigation and could also face a lawsuit if it does not come to an agreement with the cities.
San Francisco District Attorney George Gascón and Los Angeles District Attorney Jackie Lacey first warned the companies about possible legal action in September.
"The settlement with Lyft demonstrates that technical innovation and corporate responsibility are not incompatible," the DAs said, in a joint statement. "We commend Lyft for its willingness to work with law enforcement to ensure compliance with the laws that protect California consumers."
Separately, the state said Uber fraudulently charged customers a $4.00 a so-called "Airport Fee Toll" when using the UberX service for a trip to or from San Francisco International Airport "even when the UberX drivers weren't paying anything to the airport because they did not have permission to operate there."
The suit seeks refunds to consumers who paid the fees.