(Bloomberg) -- The US Senate voted to ban TikTok’s ownership by Chinese parent ByteDance Ltd., setting the stage for a constitutional clash over whether the prohibition deprives US users of their First Amendment free speech rights.

The measure, which also includes aid to Ukraine, Israel and Tawian, won sweeping bipartisan approval from senators worried about the app’s collection of data from more than 170 million American users as well as the potential for China to use it for propaganda purposes. President Joe Biden has said he will sign the measure into law.

The legislation passed by a vote of 79-18 on Tuesday night.

The bill gives the company nearly a year for ByteDance to divest from TikTok before the app would face a ban. That sets a deadline well after the November election, to the disappointment of some lawmakers worried Beijing might use the app to interfere in the election.

Read More: What a TikTok Ban in the US Would Mean for the App: QuickTake

The company is already promising to fight the legislation in court. The US is a critical market for the social media juggernaut, which has become one of the world’s fastest-growing tech giants. 

TikTok is seeking to grow the size of its US ecommerce business tenfold this year. That’s linked it inextricably to swaths of the US economy, from millions of content creators to small business owners that rely on the platform.

Beijing is unlikely to allow any sale of TikTok. The government there has made it clear it wants neither TikTok’s prized algorithms nor its valuable data to fall into American hands, a person familiar with TikTok’s thinking said, asking to remain anonymous discussing company deliberations.

Read More: China Braces for Worst as It Becomes Punching Bag in US Election

Kentucky Republican Rand Paul argued the TikTok bill violates the First Amendment and other provisions in the Constitution, and predicted the courts would overturn it.

The legislation also could ban other apps that the president rules is under the control of a foreign adversary, and it puts new limits on data brokers selling information to foreign adversaries.

The TikTok measure was put on a fast track to become law when Republican House Speaker Mike Johnson decided to include it in the aid package for Ukraine and Israel, short-circuiting what could have been a lengthy Senate debate. The House approved the TikTok-measure on a 360-58 vote Saturday.

©2024 Bloomberg L.P.