A federal judge on Thursday temporarily blocked a ban on TikTok set to come into effect next year in Montana, saying the popular video sharing app was likely to win its pending legal challenge.

US District Court Judge Donald Molloy placed the injunction on the ban until the case, originally filed by TikTok in May, has been ruled on its merits.

Molloy deemed it likely TikTok and its users will win, since it appeared the Montana law not only violates free speech rights but runs counter to the fact that foreign policy matters are the exclusive domain of the federal government.

“The current record leaves little doubt that Montana’s legislature and attorney general were more interested in targeting China’s ostensible role in TikTok than they with protecting Montana consumers,” Molloy said in the ruling.

The app is owned by Chinese firm ByteDance and has been accused by a wide swathe of US politicians of being under Beijing’s tutelage, something the company furiously denies.

Montana’s law says the TikTok ban will become void if the app is acquired by a company incorporated in a country not designated by the United States as a foreign adversary.

TikTok had argued that the unprecedented ban violates constitutionally protected right to free speech.

The prohibition signed into law by Republican Governor Greg Gianforte is seen as a legal test for a national ban of the Chinese-owned platform, something lawmakers in Washington are increasingly calling for.

The ban would make it a violation each time “a user accesses TikTok, is offered the ability to access TikTok, or is offered the ability to download TikTok.”

Each violation is punishable by a $10,000 fine every day it takes place.

Under the law, Apple and Google will have to remove TikTok from their app stores.

State political leaders have “trampled on the free speech of hundreds of thousands of Montanans who use the app to express themselves, gather information, and run their small business in the name of anti-Chinese sentiment,” ACLU Montana policy director Keegan Medrano said after the bill was signed.

The law is yet another skirmish in duels between TikTok and many western governments, with the app already banned on government devices in the United States, Canada and several countries in Europe.