Washington (CNN) Judge Amy Berman Jackson has barred Roger Stone from posting on Instagram, Facebook or Twitter and all other forms of social media after finding he purposely tried to gain media attention while under a court-imposed gag order.

The ruling came during a hearing in federal court in Washington Tuesday that addressed prosecutors' accusations that Stone had flouted the court's orders and broke his bail terms by posting on Instagram over the past several months.

In a written order Wednesday , Jackson further explained the gag order, to stress it still includes discussing the case in all forms of social media as well as prohibiting Stone from having any public statements made on his behalf "by surrogates, family members, spokespersons, representatives, or volunteers."

"Once again I am wrestling with behavior that has more to do with middle school than a court of law," Jackson said in court. "The goal has been to draw maximum attention."

Stone is not banned from posting comments unrelated to his case and the investigation on other forms of social media.

Before and after his arrest in January, Stone had been one of the most well-known critics of the Mueller investigation, aside from his longtime confidant Donald Trump. He had told the judge early in his case how his livelihood hinged around his ability to comment on politics. Jackson's ruling Tuesday is especially cutting, since Stone has more than 50,000 followers on Instagram and he had been an active poster on Facebook and a moderator of a group of his supporters. Twitter suspended his account in 2017.

Jackson first barred Stone from making public statements about his case in February, after he posted on Instagram a photo of the judge with crosshairs behind her head. He apologized to Jackson, but she still warned him of severe consequences if he crossed the line of the court's orders.

Stone's attorneys argued on Tuesday on a case by case basis that the posts were not in violation, and that Stone had tried to "hew" to the judge's order. Prosecutors argued they are clear violations of the order, and that Stone's conduct poses a risk to a fair trial.

"I've twice given you the benefit of the doubt. Your lawyer had to ... twist himself into a pretzel to argue that these posts didn't cross the line," Jackson told him.

Several times, Stone had shared on Instagram right-wing publications' stories about his case, including ones that highlighted conspiracy theories that disagree with US intelligence community findings, and had commented on Democratic Rep. Adam Schiff, the House Intelligence Committee chairman, and former CIA Director John Brennan. On another occasion, he texted a BuzzFeed News reporter that a statement made publicly by Michael Cohen wasn't true.

Over the almost three hours of proceedings Tuesday, Jackson handed Stone's defense attorney Bruce Rogow printouts of the Instagram posts and the BuzzFeed story, one by one. Jackson pinned Rogow down about each of the posts -- had Stone posted it from his account? He had, Rogow said.

Several times, Stone, in a seersucker suit, stood in the corner of the courtroom to look over the posts with his lawyers, and privately give them some explanations.

Jackson read the text of some of Stone's more colorful posts from the bench -- such as him calling Brennan a "psycho" who should be "hung for treason;" that Schiff is "bullschiff" and that Politico's reporting on his court case was a result of them being "biased elitist snot-nosed fake news s***heads."

She took a 45-minute break before deciding what to do.

When Jackson returned to the courtroom, she referred back to her earlier orders. "The clarity of my order is undisputed," adding, "It didn't take a week before the defendant was emailing BuzzFeed, calling a witness in this investigation a liar."

Jackson has handled several high-profile Mueller investigation defendants in her courtroom and has used gag orders to try to limit the circus-like atmosphere and political furor around the cases.

In some of the posts, Stone had shared right-wing online sites' coverage of accusations his lawyers made in court filings. One of those accusations, that investigators were intentionally lying as they pursued searches of Stone because they said in court papers that Russia hacked the Democratic National Committee, was another topic of discussion before Jackson Tuesday.

Stone's team hopes to cut the evidence gained in those searches from his trial, but Jackson didn't appear to be swayed by their legal arguments. "Was it reckless to rely on the US intelligence report?" Jackson asked his attorney, pointing to how intelligence authorities and the Justice Department have discredited the conspiracy theory and believe the Russian government orchestrated the hack.

Jackson also had imposed one on former Trump campaign chairman Paul Manafort's case. Before his trial, prosecutors accused Manafort of attempting to tamper with witnesses by trying to contact them, and Jackson revoked his bail, sending him to jail to await trial. He later pleaded guilty to that crime.

Stone could have faced a similar consequence on Tuesday. Jackson decided he broke the terms of his release, which allows him to live at home in South Florida while he awaits trial, the legal finding that could allow her to fine him or send him to jail. But the judge acknowledged that at times, Stone's public comments appeared to be trying to provoke her reaction. She accused his team of making an earlier court filing about the re-release of his book this spring as a way to get publicity for it, and spreading the online posts about his case as a way to comment on it.

His legal team's arguments Tuesday ignored how social media works, she said. They had focused on the number of likes his recent posts got, saying they were few.

"There is no power or speed. There are 313 likes" on one post, Rogow had argued.

Stone continues to be banned from speaking about his case, the investigation or the court on any platform or through intermediaries, and is prohibited from making public statements in and around the courthouse. He can still make public appearances and statements on other topics.

Stone was charged in late January for lying to congressional investigators about his efforts to communicate with WikiLeaks as he sought to help the Trump campaign damage Hillary Clinton in 2016. He also faces charges of obstruction and witness tampering.

He has pleaded not guilty to the charges.

Correction: This story has been corrected to state that Jackson was further explaining her gag order on Stone, but not expanding it.