WASHINGTON — A judge admonished Roger Stone on Tuesday for violating a gag order before imposing a court-mandated social media blackout on the political trickster and longtime friend of President Donald Trump.

An exasperated U.S. District Judge Amy Berman Jackson stopped short of having Stone arrested, but instead ordered him to stay off Instagram, Twitter and Facebook.

“What am I supposed to do with you?” she asked rhetorically.

The judge said Stone seeks attention “when interest in the case was flagging and wants to make himself the subject of the story.”

The government had argued that Stone violated the judge's gag order with Instagram posts that disparaged the investigation of former special counsel Robert Mueller and the broader election interference probe.

Back in February, Stone posted a photo of the judge with what appeared to be crosshairs of a gun.

The longtime GOP operative was arrested Jan. 25 in a predawn raid at his Florida home on charges accusing him of lying to Congress, engaging in witness tampering and obstructing a congressional investigation into possible coordination between Russia and Trump's 2016 presidential campaign.

Wendy Jones reported from Washington D.C. and David K. Li from New York