A US judge has blocked Montana’s ban on TikTok, saying it violated the free speech rights of users.
In May, Montana became the first US state to pass the ban which was scheduled to take effect on 1 January.
The short-video sharing app, which is owned by China’s ByteDance, sued Montana a week later.
US District Judge Donald Molloy agreed with TikTok, saying that it “violates the Constitution in more ways than one” and “oversteps state power”.
The law would have made it illegal for app stores to offer TikTok, and firms would have faced penalties of up to $10,000 (£7,097).
TikTok told the BBC that it was pleased that the “unconstitutional law” was rejected.
It added that “hundreds of thousands of Montanans can continue to express themselves, earn a living, and find community on TikTok”.
The office of Montana’s state attorney told Reuters that it was considering its next steps “to defend the law that protects Montanans from the Chinese Communist Party obtaining and using their data”.
Montana, which has a population of just over one million, banned the app from government devices last December.
TikTok says it has 150 million American users, the majority of whom are in their teens and 20s.
The app has come under scrutiny from authorities around the world over concerns that data could be passed to the Chinese government.
A congressional committee questioned its chief executive, Shou Zi Chew in March on whether that was possible.
Mr Shou repeatedly said that TikTok would never spy on Americans. He however admitted that employees had monitored the accounts of journalists.
Earlier in March, the US government said ByteDance should sell TikTok or face a possible ban in the country.
ByteDance has repeatedly denied it is controlled by the Chinese government.