A US judge has issued a temporary injunction preventing a ban on future downloads of the TikTok app.
The app had faced being blocked from Apple's App Store and Android's Google Play marketplace from 23:59 Eastern time.
Existing US-based users would have been able to continue using it.
But they would not have been able to re-download the app if they deleted it from their phones, nor have been offered software updates.
Judge Carl Nichols of the US District Court for the District of Columbia issued a temporary injunction on Sunday evening at the request of TikTok.
The opinion was sealed, meaning that no reason for the decision was released.
In a statement, TikTok said it was pleased with the decision, and vowed to keep defending its rights.
"We're pleased that the court agreed with our legal arguments and issued an injunction preventing the implementation of the TikTok app ban," the statement said.
- TikTok: Oracle confirms being picked by Bytedance to be app's partner
- TikTok and WeChat: US to ban app downloads in 48 hours
- TikTok: What TikTokers make of Trump's ban threat
TikTok had argued that forcing it off the iOS and Android app stores would have violated the First and Fifth Amendments of the US constitution.
It claimed that preventing some users joining the app unlawfully impinged upon their freedom of speech and that the firm's own right to due process would have been breached by not giving it a proper opportunity to defend itself first.
"How does it make sense to impose this app store ban tonight when there are negotiations underway that might make it unnecessary?" added a member of the app's legal team.
The US government's lawyers in turn had described the app's parent as being "a mouthpiece" for the Chinese Communist Party (CCP).
The ruling comes one week after another Chinese app – WeChat – that also faced a ban, was given its own last minute reprieve by the US courts.
National security
The long-term fate of TikTok in the US is still unclear. At present it is owned by a Chinese company, Bytedance, but operated as a separate entity to Douyin – a parallel version used by Chinese consumers.
The Trump administration has claimed Bytedance's involvement poses a unacceptable national security threat, because it would have to comply with an order to support the CCP's "malicious collection of American citizens' personal data".
Bytedance denies this, saying that TikTok's user data is kept in the US and Singapore, and so is not subject to Chinese law.Even so, after being threatened with a ban, a week ago TikTok said that it had agreed a deal to let database company Oracle and retail giant Walmart take up to a 20% stake in a new spun-off entity called TikTok Global ahead of shares in the endeavour being floated.But President Trump subsequently said he would not accept any arrangement that did not involve Bytedance ceding control to the two US firms.
TikTok's statement on Monday suggested negotiations over the deal were still ongoing.
"We will also maintain our ongoing dialogue with the government to turn our proposal, which the President gave his preliminary approval to last weekend, into an agreement," it said.
![TikTok](https://c.files.bbci.co.uk/1094C/production/_114661976_tt.jpg)
To further complicate matters, Beijing has yet to announce whether it will grant Bytedance a licence to include TikTok's algorithms in any deal.
Algorithms power the app's recommendation engine, deciding which videos to show to each user, based on the ways they have previously interacted with the product.
The algorithms are highly responsive to each person's interests, quickly picking up on shifts in behaviour, and are credited with helping make the app so popular.
If China refused to let them be included in a deal, it could scupper any sell-off.
![Presentational grey line](https://c.files.bbci.co.uk/10301/production/_98950366_presentational_grey_line464-nc.jpg)
A 'stay of execution' for a social media phenomenon
![Analysis box by James Clayton, North America technology reporter](https://c.files.bbci.co.uk/4A22/production/_114287981_jamesclayton_tr-nc.png)
TikTok really has morphed into a platform that rivals Instagram and Facebook in America.
For the US to ban the app would be simply unprecedented. And for now, it's been given a stay of execution.
The court will now take its time, as it looks into whether it's a threat to national security.
One thing that was striking in the open evidence presented though was that there was no smoking gun.
There were lots of assertions, for example that TikTok's owner Bytedance was a "mouthpiece" for the Chinese government, but no killer punch.
What this delay does is buy TikTok much needed time. They need to do three things.
Wrap up a deal with Oracle and Walmart, get Trump to support it and then get the Chinese government to approve it.
And all whilst the clock runs down. This TikTok saga isn't even close to being done.
![Presentational grey line](https://c.files.bbci.co.uk/10301/production/_98950366_presentational_grey_line464-nc.jpg)
'Critical growth'
TikTok has said it has more than 100 million active users in the US and about 700 million worldwide.
It has claimed even a temporary ban would threaten its business.
"[A] ban will cause our user base to stagnate and then precipitously decline," wrote interim boss Vanessa Pappas in a court filing.
"For TikTok to remain competitive, continued growth at this stage in our development is critical."
The US government has issued two executive orders targeting TikTok. While the first is designed to prevent it being distributed via Apple and Google, the second is more far-reaching.