A federal magistrate judge Monday agreed to a motion from the Justice Department to block former President Trump from disclosing information relating to the Mar-a-Lago case, after prosecutors said the investigation remains ongoing.

The order sides with the Justice Department in allowing Trump to see evidence collected in the case — including classified documents — but only in the presence of his attorneys.

It also blocks him from disseminating any information from the case with reporters or on social media, mirroring a similar order agreed to in the hush money case being prosecuted by authorities in New York.

“Defendants shall only have access to Discovery Materials under the direct supervision of Defense Counsel or a member of Defense Counsel’s staff. Defendants shall not retain copies of Discovery Material,” Judge Bruce Reinhart, who approved the warrant to search Mar-a-Lago, wrote in the order.

The Justice Department in its Friday request said that restrictions were required, as its investigation could yield additional arrests.

“The materials also include information pertaining to ongoing investigations, the disclosure of which could compromise those investigations and identify uncharged individuals,” the department wrote.