TikTok faced sharp questions from a US appeals court on Monday as the company scrambles to block a law that will force China-based ByteDance to sell the video-sharing app by Jan. 19 or face a total ban.

A TikTok lawyer argued in front of a three-judge panel that the law, signed by President Joe Biden in April, was a violation of the First Amendment.

The law before this court is unprecedented, and its effect would be staggering, TikToks outside attorney Andrew Pincus said during the closely-watched hearing.

“For the first time in history, Congress has expressly targeted a specific US speaker banning its speech and the speech of 170 million Americans, Pincus added.

The feds, meanwhile, doubled down on their argument that the risk of the Chinese government manipulating the app poses an unacceptable national security risk.

TikTok, headed by CEO Shou Chew, and the DOJ have asked the US Court of Appeals for the District of Columbia to make a decision by Dec. 6.

The two-hour hearing, which also included testimony from TikTok creators who say a ban would hurt their livelihoods, ended without a clear indication as to which way the panel would rule.

However, the judges appeared unconvinced by key elements of TikToks position, legal experts told The Post.

At one point, Judge Sri Srinivasan pushed back on TikToks Pincus by pointing out the case hinged on the apps China-based ownership. He raised the hypothetical question of whether Congress would be allowed to ban a foreign adversarys ownership of a media outlet within the US during a time of war.

Elsewhere, Judge Neomi Rao asserted that TikTok was relying on a very strange framework to overturn the law by essentially ignoring the fact that Congress had actually passed a law” and instead treating it as if it were a federal agency.

I had expected TikTok to face an uphill battle at this hearing, but the questioning they faced was much more critical than anticipated, said Gus Hurwitz, a senior fellow at the University of Pennsylvania Carey Law School. The judges seemed quite skeptical that the law merits strict scrutiny, or even intermediate scrutiny.

It’s hard to make predictions about these things, but after today’s argument I would say the smart money is on a unanimous and very unambiguous loss for TikTok, added Hurwitz, who noted the judges seemed to take the national security arguments very seriously.

Gautam Hans, a law professor and associate director of the First Amendment Clinic at Cornell University, said panel was was tough on TikTok.

The courts are generally deferential to Congress and wary of meddling too much in matters involving foreign affairs, Hans said. The judges seemed to focus on whether TikToks foreign ownership overrode potential First Amendment concerns, he added.

The government sought to minimize the speech interests of this case, and that definitely gained some traction with the panel, Hans added.

Regardless of the panels decision, the case is widely expected to end up in front of the Supreme Court.

The law makes it imperative that this court decide soon and it is hard to imagine that the loser will not seek Supreme Court review before the deadline, said Alan Morrison, a constitutional law expert at George Washington University Law School. I believe that the court will hear the case sometime this term.

The DOJ has argued that the divest-or-ban bill is rooted in pressing national security concerns related to TikToks Chinese ownership.

During the hearing, the feds raised the possibility that China could alter TikToks algorithm for nefarious purposes.

“It’s farcical to suggest that with this two billion lines of code 40 times as big as the entire Windows operating system, changed 1,000 times every day that somehow we’re going to detect that they’ve changed it,” DOJ attorney Daniel Tenny said.

In filings in July, the feds alleged that TikTok was able to gather sensitive data related to issues like gun control and abortion from its users and cited risks that Beijing could weaponize the app to suit its own purposes.

The feds also assert that TikTok parent ByteDance is not eligible for the same First Amendment protections as those afforded to US firms.

Aside from the First Amendment concerns, TikTok has argued that a divestment is not possible within the bills limited timeline.

Former Treasury Secretary Steven Mnuchin is among the US investors who said they would be interested in buying TikTok if it were available. As The Post has reported, Mnuchin has spoken with potential partners about a plan to rebuild TikToks recommendation algorithm in the US.

The fight over TikToks fate is playing out against the backdrop of the 2024 presidential election. Both Donald Trump and Kamala Harris are active on the platform.

The Biden-Harris administration signed the divestment bill into law.

Trump initially supported a TikTok ban but has since changed his stance, arguing that the bill risked transferring more power and market control to Instagram parent Meta and its boss Mark Zuckerberg.

With Post wires