TikTok is taking its fight against the Trump administration to the courts, filing a legal challenge Monday against the government’s order to ban the video app effective mid-September.

TikTok alleges that President Trump’s executive order is “not rooted in bona fide national security concerns,” according to excerpts of the complaint the company detailed in a blog post. It also alleges the U.S. government did not conduct a fair process in deciding that the app needed to be banned in the country and that its Chinese owner ByteDance must divest its assets in the United States.

It filed the suit Monday in federal court in the Central District of California. The Justice Department declined to comment.

The lawsuit is the latest escalation in a long-running string of events that will likely end in the popular social media app either being banned or sold to an American company. The Trump administration has long alleged TikTok may pose a national security threat, in large part due to its Chinese ownership.

TikTok is likely being caught up in a larger period of turmoil between the U.S. and China, as the president has blamed the country for the outbreak of the novel coronavirus and has engaged in a trade war.

Trump cited national security concerns as he issued an executive order this month banning the app in the United States after 45 days. It would be the first time a major consumer app is banned in the country using international emergency economic powers.

The order put pressure on deal talks already in progress for ByteDance to sell its U.S. operations of TikTok to Microsoft, Twitter or another American company. Microsoft, considered the leading suitor for the short-form video app, has said it will complete its deal talks with TikTok by Sept. 15.

TikTok’s popularity has surged in the U.S. over the past year. The company said in the lawsuit it had 91.9 million monthly active users in the country June, up from 26.7 million in February 2019. On a quarterly basis, the company says 100 million in the U.S. use the app.

TikTok’s legal challenge could also serve as a way for the company to gain the higher ground and drive up its price tag in ongoing negotiations for a buyer, a process that has become a tug-of-war between Trump’s orders — which give American companies negotiating leverage — and TikTok’s pushback.

TikTok has been engaged in a wide-reaching public relations campaign all year to convince U.S. customers and regulators that it is not a threat. It has continually insisted that it does not share information about U.S. users with the Chinese government, and even hired former Disney executive Kevin Mayer as its chief executive here.

But Trump and other lawmakers have raised concerns that TikTok could pose a national security threat because of the control China exerts over companies based there, raising fears that the company could one day be compelled to hand over customer information.

In its lawsuit, TikTok says it stores American user info in the United States and Singapore, and points to the “extraordinary measures” it says it has taken to protect user privacy.

“By banning TikTok with no notice or opportunity to be heard (whether before or after the fact), the executive order violates the due process protections of the Fifth Amendment,” TikTok’s order reads.

TikTok’s suit, which is filed against Trump, Commerce Secretary Wilbur Ross and the Commerce Department, also calls out Trump for issuing the order for “political” reasons and alleges banning the app is not allowed under the international emergency economic powers act. The order was issued before a review of an earlier ByteDance acquisition was announced, TikTok says in the suit.

“Instead, the order was issued abruptly after the President had proclaimed in a campaign-style news conference that TikTok Inc. had ‘no rights’ and that he would ban TikTok if Plaintiffs did not pay money to the U.S. Treasury to secure the U.S. government’s approval for any sale,” the lawsuit reads.

Just days before the order was issued, Trump said the U.S. Treasury should collect a “very substantial” portion of TikTok’s sale price. It is unclear under what authority that government could demand that, beyond standard fees and taxes.

TikTok can sue to challenge the underlying process of the executive order but not the merits of the decision itself, said Robert Chesney, an associate dean at the University of Texas School of Law.

“This is why TikTok is in a tough spot, unless the game is just delay,” Chesney said of a potential lawsuit.

Trump issued a second order on Aug. 14, ordering ByteDance to divest its 2017 acquisition of an app called Musical.ly, which later merged with TikTok. In its lawsuit, TikTok alleges the government process that led to that order was completed five minutes before its deadline on July 30 after a months-long review.

The decision was “principally based on outdated news articles, failed to address the voluminous documentation that Plaintiffs had provided demonstrating the security of TikTok user data, and was flawed in numerous other respects,” TikTok wrote in its lawsuit, according to the blog.

Facebook referred to TikTok as one of its leading competitors in an antitrust hearing before Congress last month. It recently released Instagram Reels, a video feature in its photo app designed to rival TikTok.