The Trump administration says that WeChat is a national security threat, as it allegedly sends massive amounts of data to the Chinese government. The Commerce Department had ordered for the messenger to be removed from Apple and Google's app stores in the US.

However, hours before the ban was set to come into effect, US Magistrate Judge Laurel Beeler of the Northern California District Court issued an injunction on Sunday blocking the removal, saying that the move raised "serious questions" about free speech.

The lawsuit was brought by a group of WeChat users, who argued that there is no alternative app for Chinese Americans to use to communicate. They also claimed that, without updates from the Android and Apple app stores, WeChat would be essentially unusable.

"The United States has never shut down a major platform for communications, not even during war times,” a lawyer for the users said. “There are serious First Amendment problems with the WeChat ban, which targets the Chinese American community."

WeChat is not the only Chinese app to come into Trump’s crosshairs. The president also moved to ban TikTok, a hugely popular video sharing app. The TikTok ban was originally due to come into effect on Sunday too, but the Commerce Department announced on Saturday that the deadline would be pushed back another week, as Oracle and Walmart continue talks to buy the platform’s US operations from Chinese firm ByteDance. Should these talks fall through, users will be locked out of TikTok on November 20.

Trump’s app crackdown has angered Beijing, which rolled out its own “unreliable foreign entity” list on Saturday. The Chinese government did not name any single US or Western company that it would place on the list, but said that any entity threatening the “national sovereignty, security or development interests of China” would be added to it.