TikTok and Facebook application on screen Apple iPhone XR. [Getty Images]

A Montana judge ruled on Thursday to block the state's ban on TikTok from going into effect, marking a win for the popular video streaming app.

U.S. District Judge Donald Molloy, who heard lawsuits filed by TikTok and five Montana content creators against the state's ban last month, said in a preliminary injunction that the move "is necessary" because the ban likely violates "their First Amendment, Supremacy Clause, and Commerce Clause claims."

In June TikTok filed the suit for the court to stop the northern state of Montana from implementing an overall ban on the video-sharing app.

TikTok said the unprecedented ban, set to start in 2024, violates the constitutionally protected right to free speech.

"We believe our legal challenge will prevail based on an exceedingly strong set of precedents and facts," a TikTok spokesperson told AFP.

Montana Governor Greg Gianforte signed the prohibition into law on May 17.

Gianforte said on Twitter that he endorsed the ban to "protect Montanans' personal and private data from the Chinese Communist Party."