The measure, passed by the U.S. House of Representatives on Saturday, has been driven by concerns that China could access Americans' data or surveil them with the app. Biden said he would sign it into law on Wednesday.
"For years we've allowed the Chinese Communist party to control one of the most popular apps in America that was dangerously shortsighted," said Senator Marco Rubio, the top Republican on the Intelligence Committee. "A new law is going to require its Chinese owner to sell the app. This is a good move for America."
TikTok, which says it has not shared and would not share U.S. user data with the Chinese government, has argued the law amounts to a ban that would violate the U.S. free speech rights of its users.
The company did not immediately comment but over the weekend, it told its employees that it would quickly go to court to try to block the legislation.
"We'll continue to fight, as this legislation is a clear violation of the First Amendment rights of the 170 million Americans on TikTok... This is the beginning, not the end of this long process," TikTok told employees on Saturday in an email seen by Reuters.
The Senate voted 79 to 18 in favor of the bill that was attached to a measure to provide $95 billion in mostly military aid for Ukraine, Israel and Taiwan.
In 2020, then-President Donald Trump was blocked by the courts in his bid to block TikTok and Chinese-owned WeChat in the United States.
The new legislation, however, is likely to give the Biden administration stronger legal footing to ban TikTok if ByteDance fails to divest the app, experts say. It also gives the White House new tools to ban or force the sale of other foreign-owned apps it deems to be security threats.
The legislation gives ByteDance 270 days to divest TikTok with a possible three-month extension.
Senate Commerce Committee Chair Maria Cantwell, a Democrat, said the timeline was reasonable. "This is not a new concept to require Chinese divestment from U.S. companies," Cantwell said. "We are giving people a choice here to improve this platform."
But Democratic Senator Ed Markey said ByteDance was unlikely to be able to execute a divestment by early 2025, adding that a sale would be one of the most complicated and expensive transactions in history, requiring months if not years of due diligence.
"We should be very clear about the likely outcome of this law. It's really just a TikTok ban," he said. "Censorship is not who we are as a people. We should not downplay or deny this trade-off."