The ruling by Judge Ethan Schulman of San Francisco Superior Court was a defeat for the ride-hailing companies, Reuters reported, as they defend against a 5 May lawsuit by state Attorney General Xavier Becerra and the cities of Los Angeles, San Diego and San Francisco.
Uber and Lyft had been accused of violating Assembly Bill 5 (AB5), a new state law requiring companies to classify workers as employees if they controlled how workers did their jobs, or the work was part of their normal business.
In a 34-page decision faulting the money-losing companies' "prolonged and brazen refusal" to comply with state law cited by Reuters, Schulman said the plaintiffs showed an "overwhelming likelihood" they could prove Uber and Lyft classified drivers illegally.
"This is a resounding victory for thousands of Uber and Lyft drivers who are working hard – and, in this pandemic, incurring risk every day – to provide for their families," Los Angeles City Attorney Mike Feuer said in a statement cited by Reuters.
Schulman delayed enforcing his order by 10 days to allow appeals, which Lyft said it would pursue.
Reuters noted California voters are expected in November to consider a ballot measure, Proposition 22, to classify app-based drivers as contractors. The state is the ride hailers' largest US market.
"Drivers do not want to be employees," Lyft retorted in a statement cited by the news agency. "Ultimately, we believe this issue will be decided by California voters and that they will side with drivers."
Uber did not immediately respond to Reuters requests for comment.
Several hundred thousand 'gig' workers, including many at ride hailing companies and app based food delivery services, are affected by AB5, which took effect on 1 January and had broad support from organised labour.
According to Reuters, Schulman said the defendants' argument they were not "hiring entities" covered by AB5 "flies in the face" of Uber's claims in other litigation, and their "concerted effort" to overturn the law in November.
He also said the public could face substantial harm if drivers were denied employee benefits such as minimum wage, paid sick and family leave, unemployment insurance and workers' compensation insurance, Reuters said.
"These harms are not mere abstractions; they represent real harms to real working people," Schulman reportedly wrote.
The judge said Uber and Lyft had themselves to blame if their resisting state laws contributed to any "far-reaching" effects an injunction might have, Reuters added.
"Defendants may not evade legislative mandates merely because their businesses are so large that they affect the lives of many thousands of people," he wrote.