A federal judge issued a gag order Friday in special counsel Robert Mueller’s case against longtime Trump associate Roger Stone.

In a four-page order, U.S. District Court Judge Amy Berman Jackson forbade attorneys for both Mueller and Stone from “making statements to the media or in public settings that pose a substantial likelihood of material prejudice to this case.” She additionally wants "to maintain the dignity and seriousness of the courthouse and these proceedings."

Jackson also said Stone is not allowed to speak about the case in or around the courthouse. She has not imposed additional restrictions on Stone but left the option open in the future.

Stone’s attorneys last week urged Jackson not to impose a gag order, arguing he had a right to speak freely because he is a writer and commentator. Jackson previously warned she would impose such an order after Stone attacked Mueller in the media after he was arrested last month at his Fort Lauderdale, Fla., home in a pre-dawn FBI raid. Stone has pleaded not guilty to lying to Congress, obstruction of an official proceeding, and witness tampering.

The judge concluded her order with some advice for Stone: "Finally, while it is not up to the Court to advise the defendant as to whether a succession of public statements would be in his best interest at this time, it notes that one factor that will be considered in the evaluation of any future request for relief based on pretrial publicity will be the extent to which the publicity was engendered by the defendant himself."

Fordham law professor Jed Shugerman wryly commented on the gag order on Twitter: "For Stone, this will be cruel and unusual punishment."

