The San Francisco and Los Angeles district attorneys have sent letters to ride-share companies Uber, Lyft and Sidecar claiming they are operating illegally and warning them that legal action could follow if they don’t make major changes.

The two district attorney offices conducted a joint investigation into the ride-share companies and found a number of practices that violate California law. The prosecutors say the practices represent “a continuing threat to consumers and the public.”

Sidecar shared its letter with the media and issued a statement saying it strongly disagrees with the thrust of the letter and has no plans to change its operations. Uber and Lyft did not immediately respond to a request for comment.

“We value innovation and new modes of providing service to the public,” San Francisco District Attorney George Gascón said in a statement. “However, we need to make sure the safety and well-being of consumers are adequately protected in the process.”

The district attorneys told all three companies that they misled customers by claiming their background checks of drivers screen out anyone who has committed driving violations, including DUIs, as well as sexual assault and other criminal offenses. The district attorneys say that’s patently untrue.

Gascón in June charged Uber driver Daveea Whitmire, 28, of striking a passenger. He had passed the company’s background check, but court records showed he had previously been convicted of felony drug dealing and misdemeanor battery.

Gascón wants the companies to remove all statements from their mobile apps, websites and other publications that imply their background checks reveal drivers’ complete criminal history.

The district attorneys also told all three companies that their new shared ride service fares — in which individuals going the same way can hop in a car and pay their fares separately — are calculated in a way that violates state law. Gascón wants the shared-ride payment features removed from the companies’ offerings.

Sidecar CEO Sunil Paul called the letter “shocking and baffling” and said he has already asked to meet both office to discuss the issues.

“We’re going to continue to operate Shared Ride,” Paul said Thursday. “We think their claims are incorrect and their assertions that we are operating illegally are simply incorrect.”

Earlier this month, the California Public Utilities Commission sent warning letters to all three that the carpool options are illegal under current state law.

However, a PUC official said the letters were also a signal to the state Legislature to update laws that were written to prevent limousine drivers from poaching passengers from existing shared-ride services like Super Shuttle.

The district attorneys accused Uber and Lyft of engaging in two additional unlawful practices. One is failure to be regulated by the state’s Department of Food and Agriculture’s weights and measures division, which regulates everything from groceries to gas stations to taxis to ensure that customers are getting the amount of food or gas or number of taxi miles they’re paying for. Uber and Lyft are also accused of failing to get the proper licenses to pick up and drop off passengers at airports.

The companies have been asked to respond to the letters by Monday and meet with representatives of the district attorney’s office by Oct. 8. If not, the prosecutors are prepared to file legal actions seeking injunctive relief and civil penalties. It’s unclear what those could entail.

The district attorneys’ move is the latest volley in the ongoing battle between local government, which regulates many things to ensure safety, and the new sharing economy sector of the tech industry, which has largely resisted being regulated and argues it doesn't fit into government's outdated rules.

The ride-sharing companies, which allow people to use their smartphones to order privately driven cars instead of taxis, have argued since their inception they shouldn’t be regulated the same way as taxis. The state PUC doesn’t see it that way.

San Francisco City Hall is grappling with how to regulate Airbnb and other companies that allow people to rent their private homes and apartments to travelers. Currently, San Francisco bans all short-term residential rentals unless people hold bed-and-breakfast licenses, but it doesn’t enforce the rules. And City Attorney Dennis Herrera in June issued a cease-and-desist letter to Monkey Parking, an app that allows people in public parking spots to auction off those spaces to the highest bidder.

Proponents of the sharing economy argue the new services help reduce waste and allow regular people to make extra money, while critics argue the term “sharing” is ludicrous because it allows people to make extra money off their cars or homes and that they’re not actually sharing anything.

Heather Knight and Benny Evangelista are San Francisco Chronicle staff writers. E-mail: hknight@sfchronicle.com, bevangelista@sfchronicle.com Twitter: @hknightsf, @ChronicleBenny