Special counsel Jack Smith subpoenaed and obtained a search warrant related to former President Trump’s account on X, according to court filings unsealed Wednesday.

The case, decided in July, ordered X, formerly known as Twitter, to turn over the documents sought by Smith and also fined the company $350,000 for a three-day delay in complying with a court order of the records.

The Justice Department (DOJ), which first sought the records in January, also obtained a nondisclosure order that prohibited X from disclosing the existence or contents of the search warrant to anyone, including Trump himself.

The filing details a months-long battle between X and the special counsel’s office over the efforts to get information tied to Trump’s account, with an appeals court backing a lower court ruling “in all respects.”

“The district court found that there were ‘reasonable grounds to believe’ that disclosing the warrant to former President Trump ‘would seriously jeopardize the ongoing investigation’ by giving him ‘an opportunity to destroy evidence, change patterns of behavior, [or] notify confederates,’” the U.S. Court of Appeals for D.C. noted in its ruling.

The lower court’s March ruling also found probable cause to search Trump’s Twitter account “for evidence of criminal offenses.”

The ruling does not offer specific details about DOJ’s warrant or the subpoena.

Trump on Wednesday bashed the move on social media, accusing DOJ of “making it a point not to let me know about this major ‘hit’ on my civil rights.”

The Justice Department routinely subpoenaed communications and tech companies, but efforts to seek so-called gag orders that block those companies from alerting the subject of the search have proven more controversial, raising First Amendment concerns.

The appeals court sided with Smith’s team, determining that the 180 window of silence sought by DOJ was within bounds given the sensitive nature of its investigation into Jan. 6 and Trump directly. 

While Twitter couched that as a First Amendment violation, the court noted the company remained free to otherwise discuss the investigation.

It rejected possible alternative plans for Twitter, including arguments that the “cat [was] out of the bag” because Trump already knew he was under investigation.

“The whole point of the nondisclosure order was to avoid tipping off the former President about the warrant’s existence,” the court wrote in its 34-page ruling.

Courts have previously allowed for such gag orders when there is fear of tampering with evidence, intimidation of potential witnesses, or other jeopardy to an investigation.

“The district court specifically found reason to believe that disclosure of the warrant would jeopardize the criminal investigation. We therefore conclude that the government’s asserted interests were unquestionably compelling,” the court wrote.

And buried in a footnote, the court says the lower court “also found reason to believe that the former President would ‘flee from prosecution.’”

The decision also details difficulties at Twitter in even relaying the subpoena during a chaotic chapter at the company, finding a website for legal requests to be “inoperative.”

The Justice Department came under fire early in the Biden administration for continuing to seek gag orders on subpoenas for the communications of several journalists first initiated under the Trump administration. 

DOJ has since changed its policy to limit such searches on members of the media.

The rule, however, does not completely bar the practice of subpoenaing journalists.

Updated at 2:14 p.m.