President Biden said Friday that he would sign legislation giving China's ByteDance about six months to divest from the widely popular TikTok video-sharing app or be banned in the United States.

"If they pass it, I'll sign it," Biden told reporters on Friday, Reuters reported.

The legislation is being fast-tracked after it unanimously passed the House Energy and Commerce Committee on Thursday and could come before a full House vote as soon as Tuesday or Wednesday.

Former President Donald Trump, the likely Republican presidential nominee, appeared to be against the legislation after previously supporting such a ban during his administration. 

In a post on his social media platform Truth Social, the former president said he feared any action against TikTok would only strengthen Facebook founder Mark Zuckerberg.

"If you get rid of TikTok, Facebook and Zuckerschmuck will double their business," Trump said. "I don't want Facebook, who cheated in the last Election, doing better. They are a true Enemy of the People!"

Trump was banned by Facebook and Instagram in January 2021 over his role in the Capitol riots, in which mobs of his supporters attempted to disrupt the congressional vote to certify Biden as the winner of the 2020 presidential election.

The accounts were restored in February 2023. Federal agencies have warned that China's ByteDance could harvest users' personal information from TikTok, which has about 170 million users in the U.S., and share it with China's government.

The legislation would give ByteDance 165 days to divest TikTok. If ByteDance doesn't comply, the legislation would bar TikTok and other ByteDance apps from the Apple and Google stores.

In 2022, Biden banned the use of TikTok on the devices of the federal government's nearly 4 million employees.

TikTok, which has said it would not share the data with the Chinese government, said the legislation has one intention.

"This legislation has a predetermined outcome: a total ban of TikTok in the United States," the company said. "The government is attempting to strip 170 million Americans of their Constitutional right to free expression. This will damage millions of businesses, deny artists an audience, and destroy the livelihoods of countless creators across the country."