Angela Lang/CNET

TikTok has won the latest round in its ongoing battle with the Trump administration.

SEE: Mobile device computing policy (TechRepublic Premium)

With a ban of the app set to take place just before midnight on Sunday, a judge in the US District Court for Washington, D.C., earlier in the day found in favor of an injunction filed by TikTok owner ByteDance challenging an executive order from Donald Trump.

Signed by Trump on Aug. 6, 2020, the order would have prohibited any US app store from distributing or maintaining the TikTok app, code, or updates. Existing users who already had the app would still have had access to it but wouldn’t have been able to get updates, while new users would have been unable to download it at all.

The order was signed in the name of national security concerns cited by the Trump administration, which has alleged that Chinese-owned TikTok collects and can share personal information about its users with the Chinese Communist government.

Originally set to take place on Sept. 20, the ban was postponed for a week following a prospective deal that promises to deliver part of TikTok to US companies Oracle and Walmart. With the Trump administration still yet to officially sign off on the deal, the Sept. 27 ban would have taken effect had it not been for ByteDance’s challenge to the executive order and the court’s last-minute decision.

“We’re pleased that the court agreed with our legal arguments and issued an injunction preventing the implementation of the TikTok app ban,” TikTok said in a statement shared with CNET. “We will continue defending our rights for the benefit of our community and employees. At the same time, we will also maintain our ongoing dialogue with the government to turn our proposal, which the President gave his preliminary approval to last weekend, into an agreement.”

In his ruling, US District Judge Carl Nichols granted the preliminary injunction pursued by ByteDance, allowing the app to stay available for downloads in US app stores. But that doesn’t mean TikTok is out of the woods just yet.

The judge denied in part ByteDance’s injunction against a series of further actions set to take effect on Nov. 12. These additional restrictions would ban any US company from hosting or using TikTok services or features, effectively killing the use of the app.

In a statement released on Sunday, the US Department of Commerce said that the government would comply with the injunction and has taken the required steps to do so. But it also referred to Trump’s executive order as consistent with the law and in the interest of national security, adding that it would defend the order against legal challenges.

TikTok is still in uncertain territory. Looking to remove any Chinese influence over the app, the Trump administration has been pushing for an acquisition of TikTok that would place it firmly under the control of US companies. On Sept. 19, TikTok announced that Oracle and Walmart had agreed to purchase up to 20% of a new US-based entity to be called TikTok Global. But who would own the remaining 80% is still a question, and one that will play a role in the approval of any potential deal.

ByteDance, a Chinese multinational company headquartered in Beijing, has said that it plans to use the money from a pre-IPO to buy an 80% stake in TikTok Global. If that happens, then the majority ownership would still technically be in China, at least on the surface. Behind the scenes, though, almost 40% of ByteDance is presently owned by US venture capitalists such as Sequoia Capital and General Atlantic, according to the Wall Street Journal.

Further, the control of TikTok data also is potentially more critical than who actually owns what part of the new company. Oracle has said that it would host all the data for the 100 million American TikTok users in its own secure cloud-based data centers.

However, none of those factors may be enough to please Trump, who apparently wants majority ownership clearly to be in the US. Referring to ByteDance’s plans to retain an 80% stake in TikTok Global, as reported by BBC News, Trump said recently: “They will have nothing to do with it. And if they do, we just won’t make the deal.”