(Bloomberg) -- A New York judge barred Donald Trump from posting evidence from his criminal case on social media, restricting the former president’s ability to make public statements about charges alleging he directed hush-money payments to an adult film actress.

State Supreme Court Justice Juan Merchan on Monday also restricted Trump from publicly disclosing details about witnesses or other evidence that Manhattan prosecutors have collected against him. The order comes as Trump is trying to get the case transfered to federal court.

Trump Defense Fights DA’s Bid to Limit Access to Evidence

Trump was indicted in March by a grand jury on 34 counts of falsifying business records for allegedly ordering payments to Stormy Daniels during his 2016 campaign to keep her quiet about an affair a decade earlier. Merchan is presiding over the case. Trump has pleaded not guilty and denies the alleged affair with Daniels.

When Trump was arraigned April 4, prosecutors in the office of Manhattan District Attorney Alvin Bragg expressed concern that he had made threatening and derogatory public statements about the DA and the case, but they stopped short of seeking restrictions. Three weeks later, they said a protective order was warranted because of Trump’s social-media posts and other public statements he’d made about his case.

Trump Sues Ex-Lawyer Cohen for $500 Million Over ‘Breaches’

Bragg cited Trump’s history of attacking potential witnesses, including Michael Cohen, his former lawyer and “fixer” who paid $130,000 to Daniels just before the 2016 election — and pleaded guilty to crimes including campaign finance violations and bank fraud. After his indictment, Trump sued Cohen. 

Prosecutors also cited Trump’s history of targeting witnesses against him in criminal investigations, including ridiculing witnesses and officials involved in Special Counsel Robert Mueller’s investigation of Russian interference in the 2016 election, as well as two separate impeachment trials in Congress.

At a May 4 hearing, Merchan rejected arguments from Trump lawyers Susan Necheles, Todd Blanche and Joe Tacopina, who had called the district attorney’s request “extreme” and said any restrictions on the former president should also apply to prosecutors.

On Monday, Merchan said anyone with access to the evidence “shall not copy, disseminate or disclose” the material to any third party, including Trump’s Truth Social platform, “without prior approval from the court.”

Trump can review “limited” material “only in the presence of defense counsel, but defendant shall not be permitted to copy, photograph, transcribe or otherwise independently possess” this evidence, according to the judge’s order.

The judge also said prosecutors can delay disclosing to Trump’s team the names and information about employees with the DA’s office who worked on the case until just before trial. 

A May 4 request by Trump to move the case to federal court has been assigned to US District Judge Alvin Hellerstein in Manhattan. Bragg’s office asked Hellerstein to schedule a hearing as soon as possible, saying in a filing Monday that “prompt resolution” is needed to “minimize disruption to New York’s traditional state authority to punish local criminal activity.”

The case is The People of the State of New York v. Trump, 71543-23, Supreme Court, State of New York, County of New York.

(Updates with Bragg’s office asking for hearing on motion to transfer case to federal court.)

©2023 Bloomberg L.P.