Prop 22 bypasses a state law that would have reshaped the gig economy.
The ballot initiative in California would allow companies like Uber and Lyft to keep classifying workers as contractors.
Competitors may look to start offering rides in the state.
Both companies had threatened to shut down if a ruling went into effect Friday morning that would have forced them to treat all their drivers as employees.
The dispute could put jobs at stake during the pandemic.
The debate over gig worker classification has called labor law into question.
The ride-hailing companies now have 10 days to appeal the ruling.
As its ride-sharing business declined, the company pivoted to delivery.
The issue has big implications for workers' access to safety net benefits that have become crucial during the pandemic.
The companies announced Monday that Uber will acquire Postmates for about $2.65 billion in an all-stock deal.