WASHINGTON — Roger Stone headed back to court Thursday after posting a threatening picture to Instagram of U.S. District Judge Amy Berman Jackson, who is presiding over the criminal case against Stone and previously handled the case of his Trump presidential campaign colleague Paul Manafort.

Jackson ruled to amend the gag order issued last Friday. Stone cannot speak publicly about the case to the media or through any forms of social media. He is still allowed to tweet about his defense fund and say he is innocent. If he violates this amendment, the court may confiscate Stone’s electronics.

“Today I gave you a second chance, but this is not baseball. You do not get a third chance,” Jackson said.

Stone posted a photo to Instagram Monday depicting Jackson with what appeared to be crosshairs behind her head. His caption called Special Counsel Robert Mueller a “Deep State hitman” and condemned Jackson as an Obama administration-appointed judge who dismissed the Benghazi allegations against Hillary Clinton. The photo was re-posted with the crosshairs cropped out, then removed altogether.

Stone later posted to Instagram saying the photo had been misinterpreted. “This was a random photo taken from the Internet,” he wrote in the post. He said the crosshairs are the logo of an organization that posts in the Facebook page Corruption Central. In court today, he said he originally believed the symbol to be from a Celtic cult.

“I’m kicking myself for my stupidity. It was an egregious, stupid mistake,” Stone said. “My bad judgment is born out of emotional stress of the situation.” Stone said he is struggling to feed his family and troubled by media networks speculating about his safety were he to go to prison.

Stone first said one of his volunteers posted the image. A few minutes later, he said the volunteer picked the image and he posted it. He finally said his volunteer gave him multiple images and he randomly picked one and posted it.

When asked which volunteer, he said he was not sure. He has 5 or 6 volunteers and only remembers some of their names. “It’s a revolving door situation,” he said.

“’Randomly’ does not imply the use of human intelligence,” Jackson said in response. “Did you close your eyes and pick?”

In an apology issued to the D.C. District Court late Monday, Stone said the comment was improper and should not have been posted. “I had no intention of disrespecting the Court and humbly apologize to the Court for the transgression,” he wrote.

The gag order issued last Friday required all participants in the case to refrain from making statements to the media or public, including when entering or exiting the courthouse or when they are in the vicinity of the courthouse.

The gag order is meant to “safeguard the defendant’s right to a fair trial” by ensuring no member of the public who could potentially sit on the jury is biased by pretrial publicity.

The government prosecutor Jonathan Kravis said the amplified media attention the Instagram post brought and Stone’s subsequent media interviews will compromise the integrity of a public jury.

“What will get him to stop talking other than a court order?” Jackson asked Stone’s attorney Bruce Rogow. He replied that the two of them telling Stone will stop him. “I am the court order,” Jackson said.

“Sometimes a person learns a lesson,” Rogow said. “Especially when a person is unrestrained in his speaking.”

Stone was arrested by the FBI in his Florida home in January on five counts of making false statements, one count of obstruction and one count of witness tampering. Stone has denied all charges, which are connected to Mueller’s investigation into Russian involvement in the 2016 presidential election.