Montana is set to become the first US state to ban Chinese-owned media giant TikTok from personal devices.
Governor Greg Gianforte signed the ban into law on Wednesday. It is due to take effect on 1 January.
The video-sharing platform says the ban "infringes on the First Amendment rights of the people of Montana".
TikTok has come under scrutiny from authorities around the world over concerns that data could be passed to the Chinese government.
Mr Gianforte, a Republican, told lawmakers that a wider ban would further "our shared priority to protect Montanans from Chinese Communist Party surveillance."
TikTok said in a statement that it was used by "hundreds of thousands of people" in Montana.
"We want to reassure Montanans that they can continue using TikTok to express themselves, earn a living, and find community as we continue working to defend the rights of our users inside and outside of Montana," it added.
TikTok is expected to challenge the legislation in the courts.
Last month, lawmakers in Montana passed a bill banning TikTok on personal devices by a vote of 54 to 43.
The law will make it illegal for app stores to offer TikTok, but does not ban people who already have TikTok from using it.
Montana, which has a population of just over 1m, banned the app on government devices last December.
TikTok says it has 150m American users. Although the app's user base has expanded in recent years, it is still most popular with teenagers and users in their 20s.
However, there are concerns across the US political spectrum that TikTok could be a national security risk.
TikTok is owned by ByteDance – a Chinese company.
In March, a congressional committee grilled TikTok chief executive Shou Zi Chew about whether the Chinese government could access user data or influence what Americans see on the app.
Mr Shou repeatedly said that it would never spy on Americans – despite admitting that employees had used the TikTok accounts of journalists to obtain information about them.
Earlier in March, the US government said ByteDance should sell TikTok or face a possible ban in the country.
The penalties apply to companies, but not individual users. Firms that break the law face penalties of up to $10,000 (£8,012), which would be enforced by Montana's Department of Justice.
It means that technology giants like Apple and Google could face fines if they allow TikTok to be downloaded in Montana from their app stores.
TikTok's owner ByteDance has repeatedly denied it is controlled by the Chinese government.
You may also be interested in:
This video can not be played
Watch: The fight over TikTok explained in 60 seconds
What could a TikTok ban mean for creators?
TikTok defends app following government phone ban
The good and bad of ADHD content on TikTok
TikTokers give their lives Wes Anderson treatment
Montana becomes first US state to pass TikTok ban
'We’re ready to begin counter-offensive' – Ukraine
Erdogan and rival clash in desperate race for votes
US debt talks continue with new 5 June deadline
Friend to foe: How Imran Khan took on Pakistan's army
Cairo masterplan threatens ancient City of the Dead
Fanfare, flags and fire: Photos of the week
Why South Korea pays young recluses to leave home
The five tests awaiting Nigeria's new president
How Jords became the first UK rapper on Motown
Who are India's next cricketing stars?
The benefits of intermittent fasting. Video
What five more years of Erdogan would mean
Why it's 'imperative' to start using AI
Jellyfish blooms: Why not just eat them?
A 5,000-year-old craft under threat
© 2023 BBC. The BBC is not responsible for the content of external sites. Read about our approach to external linking.