The US special counsel investigating Donald Trump obtained a secret search warrant for the ex-president’s Twitter data in January, unsealed records show.
Jack Smith requested “data and records” relating to Mr Trump’s account which may have included unpublished posts.
After initially resisting the warrant, Twitter eventually complied, but missed a court-ordered deadline by three days.
The delay resulted in the company being handed a $350,000 (£275,000) fine for contempt of court.
The existence of the search warrant and the legal fight over it was revealed in court documents unsealed on Wednesday.
According to the unsealed ruling, which still includes some redactions, Twitter’s lawyers did not object to the warrant itself, but disputed the nondisclosure order which kept it secret.
The company, now known as X under the ownership of Elon Musk, argued that it should be allowed to notify customers whose accounts are subject to search warrants.
X handed over the data in February, but appealed the fine. Its case was rejected by a US appeals court last month.
There is little indication in the documents about what exactly Mr Smith was seeking, with the court filing noting that only that the warrant directed the company “to produce data and records” related to Mr Trump’s account.
The US congressional panel investigating the 6 January 2021 Capitol riot found that Mr Trump had drafted – but never sent – a tweet urging his supporters to come to Washington.
It said: “I will be making a Big Speech at 10 a.m. on January 6th at the Ellipse (South of the White House). Please arrive early, massive crowds expected. March to the Capitol after. Stop the steal!”
The @realdonaldtrump account, which has 86.5m followers, was suspended after the riot.
It was reinstated in November 2022 after Mr Musk ran a poll asking users whether the former president should be allowed back on the platform.
Mr Trump has not posted on X since being reinstated, instead preferring to use his own Truth Social network.
Experts have noted that his Truth Social business contracts mean he potentially stands to lose millions if he resumes posting on X.
Mr Trump responded to news of the search warrant on Truth Social, writing that it was a “major ‘hit’ on my civil rights… These are DARK DAYS IN AMERICA!”
He has been charged in the two investigations led by Mr Smith, one surrounding events following the 2020 election and the other relating to the handling of classified documents.