Uber and Lyft cannot classify their drivers as independent contractors in California, according to the latest court ruling.

The decision is a major defeat for the two ride-hailing companies and a result of a lawsuit filed by state Attorney General Xavier Becerra and the cities of Los Angeles, San Diego and San Francisco. Uber and Lyft have 10 days to appeal against a preliminary injunction, with the latter saying it will pursue.

The two ride-hailing companies have been accused of not conforming to the Assembly Bill 5, one of California’s new state laws that require companies to classify their workers as employees if they control how the workers do their jobs or work is part of their business, Reuters reports.

“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.

Read Also: Prosecutors Seeking 2-Year Prison Sentence For Engineer Who Stole Google’s Autonomous Secrets

California voters will decide on Proposition 22, a ballot measure to classify app-based drivers as contractors, this November. Lyft said in a statement that “drivers do not want to be employees. Ultimately, we believe this issue will be decided by California voters and that they will side with drivers.”

Uber on the other hand, will likely shut down temporarily in California for several months if the ruling does not overturn, according to the company’s CEO Dara Khosrowshahi, who spoke to CNBC.

“If the court doesn’t reconsider, then in California, it’s hard to believe we’ll be able to switch our model to full-time employment quickly”, Khosrowshahi said.

The judge said that Uber and Lyft had themselves to blame if their resisting state laws contributed to any “far-reaching” effects an injunction might have. “Defendants may not evade legislative mandates merely because their businesses are so large that they affect the lives of many thousands of people,” the judge wrote.