Lawyers for TikTok have pleaded with a US federal judge to delay the Trump administration’s ban of the popular video sharing program from app stores set to take effect later on Sunday.

They argue the move would infringe on First Amendment rights and do irreparable harm to the business.

The 90-minute hearing came after US President Donald Trump declared this summer that TikTok was a threat to national security and that it either sold its US operations to American companies or the app would be barred from the country.

ByteDance building
TikTok is owned by Chinese company ByteDance (Ng Han Guan/AP)

TikTok, owned by Chinese company ByteDance, is scrambling to firm up a deal tentatively struck a week ago in which it would partner with tech company Oracle and retailer Walmart and that would get the blessing of the Chinese and American governments. In the meantime, it is fighting to keep the app available in the US.

The ban on new downloads of TikTok, which has about 100 million users in the US, was delayed once by the government. A more comprehensive ban is scheduled for November, about a week after the presidential election.

Judge Carl Nichols of the US district court for the District of Columbia said he would make a decision by late on Sunday, leaving TikTok’s fate hanging.

In arguments to Judge Nichols, TikTok lawyer John Hall said that the program was more than an app but rather was a “modern-day version of a town square”.

“If that prohibition goes into effect at midnight, the consequences immediately are grave,” Mr Hall said.

“It would be no different than the government locking the doors to a public forum, roping off that town square” at a time when a free exchange of ideas was necessary heading into a polarised election.

TikTok lawyers also argued that a ban on the app would stop tens of thousands of potential viewers and content creators every month and would also hurt its ability to hire new talent.

In addition, Mr Hall argued that a ban would prevent existing users from automatically receiving security updates, eroding national security.

WeChat and TikTok icons
Donald Trump made executive orders in August declaring TikTok and WeChat threats to national security (Mark Schiefelbein/AP)

Justice Department lawyer Daniel Schwei sought to undercut TikTok lawyers’ arguments, saying that Chinese companies were not purely private and were subject to intrusive laws compelling their co-operation with intelligence agencies.

The Justice Department has also argued that economic regulations of this nature generally were not subject to First Amendment scrutiny.

Plaintiffs could not claim a First Amendment right in hosting TikTok itself as a platform for other people’s speech because merely hosting a platform was not an exercise of the First Amendment, the Justice Department contended.

“This is the most immediate national security threat,” Mr Schwei argued.

“It is a threat today. It is a risk today and therefore it deserves to be addressed today even while other things are ongoing and playing out.”

Mr Schwei also argued that TikTok lawyers had failed to prove it would suffer irreparable business harm.

The Justice Department laid out its objections to TikTok’s motion for a temporary injunction in a brief under seal, but it was unsealed in redacted form to protect confidential business information.

Donald Trump
Donald Trump said he would approve a proposed deal in which Oracle and Walmart could initially own a combined 20% of a new US entity, TikTok Global (Alex Brandon/AP)

Mr Trump set the process in motion with executive orders in August that declared TikTok and another Chinese app, WeChat, threats to national security.

The White House said the video service was a security risk because the personal information of its millions of US users could be handed over to Chinese authorities.

Mr Trump has said he would approve a proposed deal in which Oracle and Walmart could initially own a combined 20% of a new US entity, TikTok Global. The president also said he could retract his approval if Oracle did not have “total control”.

The two sides of the TikTok deal have also appeared at odds over the corporate structure of TikTok Global. ByteDance said last week it would still own 80% of the US entity after a financing round. Meanwhile, Oracle put out a statement saying that Americans “will be the majority and ByteDance will have no ownership in TikTok Global”.

Chinese media have criticised the deal as bullying and extortion, suggesting that the Chinese government is not happy with the arrangement.

ByteDance said on Thursday it had applied for a Chinese technology export license after Beijing tightened control over exports last month in an effort to gain leverage over Washington’s attempt to force an outright sale of TikTok to US owners.

China’s foreign ministry has said the government will “take necessary measures” to safeguard its companies but gave no indication what steps it could take to affect TikTok’s fate in the United States.

TikTok is suing the US government over Mr Trump’s August 6 executive order, saying it was unlawful. So were resulting Commerce Department prohibitions that aim to kick TikTok out of US app stores and, in November, essentially shut it down in the US, it claimed.

The Chinese firm said the president did not have the authority to take these actions under the national security law he cited; that the ban violated TikTok’s First Amendment speech rights and Fifth Amendment due process rights; and that there was no authority for the restrictions because they were not based on a national emergency.