By Katy Stech Ferek

TikTok's lawyers on Sunday awaited a ruling from a federal judge on the company's request to postpone a U.S. ban on downloading the popular video-sharing app, set to take effect around midnight.

Judge Carl Nichols of the U.S. District Court in Washington, D.C., said Sunday morning that he would decide by the end of the day whether the Trump administration's national-security concerns are urgent enough for it to go through with the proposed download ban.

After 11:59 p.m. Eastern time on Sunday, U.S. authorities could force Apple Inc. and Alphabet Inc.'s Google to remove TikTok from their mobile app stores, preventing new downloads by people who don't already have the app and restricting current users from downloading upgrades that keep the app fresh. Until recently, more than 400,000 people in the U.S. each day were downloading TikTok, the company has said.

The court drama played out as the app's long-term fate remained uncertain. TikTok and ByteDance executives are seeking approval from officials in the U.S. and China for a proposal to preserve the app's U.S. presence by partnering with Oracle Corp. and Walmart Inc.

While the broad strokes of a deal gained preliminary approval from President Trump on Sept. 19, TikTok, Oracle and Walmart still need to hammer out the details, including ownership structure. The deal also requires approval from The Committee on Foreign Investment in the U.S., a panel of national-security experts who oversee cross-border deals.

The U.S. Commerce Department on Nov. 12 plans a full ban designed to make the app unusable if an American deal for TikTok isn't completed by then. TikTok says the app has more than 50 million daily active U.S. users.

Governments in both countries are actively reviewing ByteDance's proposed resolution to the standoff. They are driven by competing interests.

In China, officials are worried about ByteDance losing control of the popular app and its underlying technology, and about the precedent that would be set by U.S. owners taking over a China-based company's intellectual property.

In the U.S., officials have said they are reviewing any deal with an eye toward meeting their own goal: wresting control of TikTok from Chinese owners over concerns that the data TikTok collects from U.S. consumers could be shared with the Chinese government, threatening U.S. national security. TikTok has said it operates independently of the Chinese government and that it wouldn't turn over its data if pressured.

ByteDance's proposed deal with Oracle and Walmart is designed to address concerns on both sides of the Pacific Ocean.

Under a preliminary deal that Mr. Trump approved in concept, Oracle and Walmart would take a combined 20% in TikTok Global, a new U.S.-based company that would run the global service. Details of the structure are still in flux, people involved with the deal talks have said, as the companies try to ensure that it will win final approval from governments on both sides.

One point of confusion has been the exact ownership breakdown, with the TikTok side and Oracle having issued contradictory messages since the preliminary deal was announced. A spokesman for ByteDance has said that it would directly hold an 80% share of TikTok Global, while Oracle has said publicly that Americans will be the majority owners and ByteDance will have no ownership in TikTok Global.

One way those claims could square, according to some people familiar with the talks, is to have ByteDance initially own its majority stake in TikTok when the deal is completed, and then have it reduced soon afterward. That could come by distributing ByteDance's stake to existing shareholders, many of whom are U.S. investors, and through a fundraising round ahead of a U.S. initial public offering that deal participants have said would come within a year.

But another person close to the situation disputed that theory and said Americans will be the majority owners as soon as the new company is formed.

With the deal reviews continuing, TikTok argued in court Sunday that the imminent ban on downloads would harm its business. "This is just punitive," TikTok lawyer John Hall said during Sunday morning's arguments. "This is just a blunt way to whack the company now while doing nothing to achieve the stated objective of the prohibitions."

Justice Department lawyer Daniel Schwei defended the federal government's intent to protect TikTok users' personal data and stop new users from potentially putting even more data at risk.

Commerce Secretary Wilbur Ross is entitled "to address the most important, immediate threat to national security which is new users continuing to sign up and making their data vulnerable to the Chinese government," Mr. Schwei said.

In a memo filed with the court on Friday, the U.S. government said one reason for concern is a "high level" of activity between U.S.-based TikTok users and IP addresses located in China and owned by a Chinese company. The memo also said that before February 2019, TikTok stored its U.S. user data in China.

TikTok has said it hasn't and wouldn't share information about U.S. users with the Chinese government.

Prior to Sunday's hearing, other tech companies weighed in on TikTok's side.

"There is no previous example in U.S. history of a complete ban of a media platform that directly deprives a quarter of the U.S. population access to information on that platform," NetChoice, a trade group that represents online giants such as Amazon.com Inc., Facebook Inc. and Google, said in a court filing.

The group also warned that the Trump administration's ban could provide other governments "with new justifications for preventing American technology businesses from accessing foreign markets." It said the U.S. government hasn't provided "evidence that China's Communist Party or military have acquired data on TikTok's users in the United States," adding that the government could address its concerns in other ways, such as data security safeguards.

Vanessa Pappas, TikTok's interim head, had previously encouraged other tech companies to support TikTok's litigation.

Write to Katy Stech Ferek at katherine.stech@wsj.com