Uber and Lyft have been granted a reprieve in a row over drivers' employment rights in California after a court granted an emergency injunction.
The ride-hailing firms had threatened to suspend operations over an earlier ruling that they must classify drivers as employees, not contractors.
But the reprieve allows them to continue operating while the court considers their case for appeal.
The court's decision came just hours before Lyft was due to halt rides.
The court has ordered Uber and Lyft to both submit their plans for hiring employees by early September, and oral arguments in the case are set for mid-October.
Lyft was due to stop its services in California at 23:59 local time on Thursday (06:59 GMT on Friday).
"This is not something we wanted to do, as we know millions of Californians depend on Lyft for daily, essential trips," Lyft had said in a statement posted online.
Both firms have always argued their drivers are self-employed contractors.
But a California law that came into effect earlier this year, known as AB5, extended employee classification to workers in the "gig economy".
The judge's ruling that the law applied to both Uber and Lyft means the firms need to provide drivers with extra benefits, such as unemployment protection.
Both companies filed an appeal to the judgement - and asked for a stay on its enforcement while the courts dealt with the appeal.
Unless the stay was granted, both companies had 10 days to undertake what they saw as a significant overhaul of their business in California.
They both warned that they could be forced to pull services from the state at the end of the day on Thursday.
What did the firms say?
Lyft claims that four out of five of its drivers do not want to be classified as employees. Both argue that flexibility is valued by those who choose to work for them.
The two firms had been emailing customers and sending app push notifications to try to drum up support for their side of the argument.
Uber chief executive Dara Khosrowshahi, meanwhile, wrote an opinion piece for the New York Times, arguing that his firm was not truly against paying the costs of things like health insurance.
Instead, he argued that the choice between being a full-time employee and a "gig" worker was a problem itself, and laws needed to be changed. He argued for a system where companies pay benefits based on a rate per hour worked.
But he has also said that the company can only offer full jobs to a tiny fraction of its workforce. In a podcast interview with Vox Media, he summed up the problem as: "We can't go out and hire 50,000 people overnight."
Lyft echoed that sentiment, telling the court that it "cannot make the changes the injunction requires at the flip of a switch".
The companies do have some outside support.
Some drivers do not want to be classed as employees, and the mayors of San Diego and San Jose - one Democrat and one Republican - joined forces to warn that shutting down the services "virtually overnight" would hurt one million residents in the state.
What happens next?
There is a potential way out for the ride-sharing firms in the coming months.
A ballot that will be put to vote in November, at the same time as the US presidential election, would grant Uber and Lyft an exemption from the law. It is known as proposition 22.
"Your voice can help," Lyft wrote in its blog post about suspending services.
"Prop 22, proposes the necessary changes to give drivers benefits and flexibility, while maintaining the rideshare model that helps you get where you need to go," it said.
Both companies, along with other supporters such as food delivery app DoorDash, are reported to have spent millions of dollars in lobbying and campaigning for the law.
Labour groups, meanwhile, are set firmly against it, arguing it will save the companies vast sums of money at the expense of drivers.