A judge has blocked a US government attempt to ban the Chinese messaging and payments app, WeChat.
US Magistrate Judge Laurel Beeler said the ban raised serious questions related to the constitution's first amendment, guaranteeing free speech.
The Department of Commerce had announced a bar on WeChat appearing in US app stores from Sunday, effectively shutting it down.
The Trump administration has alleged it threatens national security.
It says it could pass user data to the Chinese government.
Both WeChat and China have strongly denied the claim. Tencent, the conglomerate that owns WeChat, had previously described the US ban as "unfortunate".
The ruling comes just after TikTok, which was also named in the Department of Commerce order, reached a deal with US firms Oracle and Walmart to hopefully allow them to keep operating.
What happened in court?
The case came to court after a group of US WeChat users challenged President Donald Trump's executive order that sought to shut WeChat down in the country.
About 19 million people in the US are regular users of the app.
The US Justice Department argued that blocking the executive order would "frustrate and displace the president's determination of how best to address threats to national security".
However Judge Beeler, sitting in San Francisco, noted that "while the general evidence about the threat to national security related to China (regarding technology and mobile technology) is considerable, the specific evidence about WeChat is modest".
Why does the US want the apps banned?
The US Department of Commerce Secretary Wilbur Ross said in a statement that the decision to block the app was taken "to combat China's malicious collection of American citizens' personal data".
The department said WeChat collected "vast swathes of data from users, including network activity, location data, and browsing and search histories".
Friday's statement from the commerce department said the governing Chinese Communist Party "has demonstrated the means and motives to use these apps to threaten the national security, foreign policy, and the economy of the US".
Tencent, which owns WeChat, has said that messages on its app are private.
What is WeChat?
WeChat was set up in 2011. It is a multi-purpose app allowing users to send messages, make mobile payments and use local services. It has been described as an "app for everything" in China and has more than one billion monthly users.
Like all Chinese social media platforms, WeChat must censor content the government deems illegal. In March, a report said WeChat was censoring key words about the coronavirus outbreak from as early as 1 January.
But WeChat insists encryption means others cannot "snoop" on your messages, and that content such as text, audio and images are not stored on its servers - and are deleted once all intended recipients have read them.