A US federal appeals court on Friday upheld a law requiring Chinese-based ByteDance to divest its popular short video app TikTok in the United States by early next year or face a ban.

The decision is a win for the Justice Department and opponents of the Chinese-owned app and a devastating blow to ByteDance. The ruling now increases the possibility of an unprecedented ban in just six weeks on a social media app used by 170 million Americans.

The ruling is expected to be appealed to the Supreme Court.

Free speech advocates immediately criticized the decision. The American Civil Liberties Union said it sets a “flawed and dangerous precedent.”

“Banning TikTok blatantly violates the First Amendment rights of millions of Americans who use this app to express themselves and communicate with people around the world,” said Patrick Toomey, deputy director of the ACLU’s National Security Project.

But the appeals court said the law “was the culmination of extensive, bipartisan action by the Congress and by successive presidents. It was carefully crafted to deal only with control by a foreign adversary, and it was part of a broader effort to counter a well-substantiated national security threat posed by the PRC (People’s Republic of China).”

US appeals court Judges Sri Srinivasan, Neomi Rao and Douglas Ginsburg considered the legal challenges brought by TikTok and users against the law that gives ByteDance until Jan. 19 to sell or divest TikTok’s US assets or face a ban.

The decision — unless the Supreme Court reverses it — puts TikTok’s fate in the hands of first President Joe Biden on whether to grant a 90-day extension of the Jan. 19 deadline to force a sale and then President-elect Donald Trump, who takes office on Jan. 20. But it’s not clear whether ByteDance could meet the heavy burden to show it had made significant progress toward a divestiture needed to trigger the extension.

Trump, who unsuccessfully tried to ban TikTok during his first term in 2020, said before the November presidential election he would not allow the TikTok ban.

TikTok said it expected the Supreme Court would reverse the appeals court decision on First Amendment grounds.

“The Supreme Court has an established historical record of protecting Americans’ right to free speech, and we expect they will do just that on this important constitutional issue,” TikTok said in a statement, adding the law will result “in outright censorship of the American people.”

The Justice Department did not have an immediate comment on the decision.

The decision upholds the law giving the U.S. government sweeping powers to ban other foreign-owned apps that could raise concerns about collection of Americans’ data. In 2020, Trump also tried to ban Tencent-owned WeChat, but was blocked by the courts.

Shares of Meta Platforms, which competes against TikTok in online ads, hit an intraday record high following the ruling, last up over 3%. Google parent Alphabet, whose YouTube video platform also competes with TikTok, was up over 1% following the ruling.

TIKTOK BAN LOOMS

The court acknowledged its decision would lead to TikTok’s ban on Jan. 19 without an extension from Biden.

“Consequently, TikTok’s millions of users will need to find alternative media of communication,” the court said, which was because of China’s “hybrid commercial threat to U.S. national security, not to the U.S. Government, which engaged with TikTok through a multi-year process in an effort to find an alternative solution.”

The opinion was written by Ginsburg, an appointee of President Ronald Reagan, and joined by Rao, who was named to the bench by Trump, and Srinivasan, an appointee of President Barack Obama.

The Justice Department says under Chinese ownership, TikTok poses a serious national security threat because of its access to vast personal data of Americans, asserting China can covertly manipulate information that Americans consume via TikTok.

U.S. officials have also warned TikTok’s management is beholden to the Chinese government, which could compel the company to share the data of its American users.

TikTok has denied it has or ever would share U.S. user data, accusing American lawmakers in the lawsuit of advancing “speculative” concerns.

TikTok and ByteDance argue the law is unconstitutional and violates Americans’ free speech rights. They call it “a radical departure from this country’s tradition of championing an open Internet.”

ByteDance, backed by Sequoia Capital, Susquehanna International Group, KKR & Co, and General Atlantic, among others, was valued at $268 billion in December 2023 when it offered to buy back around $5 billion worth of shares from investors, Reuters reported then.

The law prohibits app stores like Apple and Alphabet’s Google from offering TikTok and bars internet hosting services from supporting TikTok unless ByteDance divests TikTok by the deadline.

Apple and Google did not immediately respond to requests for comment.

In a concurring opinion, Srinivasan acknowledged the decision will have major impacts, noting “170 million Americans use TikTok to create and view all sorts of free expression and engage with one another and the world. And yet, in part precisely because of the platform’s expansive reach, Congress and multiple Presidents determined that divesting it from (China’s) control is essential to protect our national security.”

He added that “Because the record reflects that Congress’s decision was considered, consistent with longstanding regulatory practice, and devoid of an institutional aim to suppress particular messages or ideas, we are not in a position to set it aside.”