According to leaked documents, the US special counsel investigating Donald Trump acquired a secret search warrant for the ex-president’s Twitter data in January.
Jack Smith asked for “data and records” on Mr Trump’s account, which might have included unpublished postings.
Twitter finally obliged after first opposing the request, albeit three days beyond the court-ordered deadline.
The corporation was fined $350,000 (£275,000) for contempt of court as a result of the delay.
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.
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.
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.