Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A federal judge banned Roger Stone from speaking publicly about his case on Thursday, after hauling him back to court to answer for an Instagram post attacking her.

"Publicity cannot subside if it's the defendant that's fanning the flames," U.S. District Judge Amy Berman Jackson said Thursday, making it clear that a violation of the strict gag order would mean jail for the former Trump adviser.

"Today, I gave you a second chance. This is not baseball, you don’t get a third chance," she told Stone.

Stone can still raise funds for his legal defense and maintain his innocence publicly, but he cannot comment on the case or its participants, the judge said.

Before issuing her ruling, Jackson said Stone "couldn't keep his story straight on the stand" when she allowed him the opportunity to explain his decision to post an image of her on Instagram with what appeared to be the crosshairs of a gun near her head. His apology, she said, rang "hollow."

The Instagram post in question, posted to Stone's account earlier this week, was accompanied by a caption in which he suggested Jackson was politically biased, slammed Robert Mueller’s Russia probe and sought donations for his legal defense. Stone later said his post wasn't meant to be threatening and deleted it.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"I am hurtfully sorry for my own stupidity. I am kicking myself, not as much as my wife is kicking me," Stone told the court Thursday. He called the Instagram post "a momentary lapse of judgment" before saying that the photo was selected by someone who works for him, which he estimated was about "five or six people."

Stone also said he "didn't think they were crosshairs."

Jackson, who is presiding over his prosecution, responded to Stone's Instagram post by scheduling the hearing to discuss "why the media contact order entered in this case and/or his conditions of release should not be modified or revoked in light of the posts on his Instagram account."

Her options included revoking his bail.

Stone's attorneys argued Thursday that Stone, who said he was broke and struggling to deal with the stress, did not violate the limited gag order or the conditions of his release. They assured Jackson that Stone would not repeat his mistake.

"Sometimes a person learns a lesson, especially when a person is unrestrained in his speaking. It’s indefensible," Stone attorney Bruce Rogow said.

"I agree with you there," the judge said.

Government prosecutors sought a stricter gag order.

"I would submit that the defendant's testimony at this hearing was not credible," prosecutor Jonathan Kravis said. "That he committed a lapse in judgement is belied by the fact that even after he realized the post was a mistake, he continued to make statements to the media that amplified that message."

Stone, who was arrested by the FBI in January, faces seven charges arising from Mueller's investigation into possible collusion between the Trump campaign and Russia, including five counts of making false statements, one count of obstruction and one count of witness tampering. Stone has denied all charges.

After Stone gave a slew of media interviews, Jackson issued a limited gag order in the case last week that prevents Stone from speaking to the press about the case in the vicinity of the courthouse.

Neither the limited gag order, nor the threat of jail time, discouraged Stone from giving interviews or posting about his case.

On his way to court Thursday morning, he was on Instagram again, posting a photo of him posing with merchandise he's selling in support of his legal defense.

“Help me in my epic fight against the anti-@realdonaldTrump Deep State,” he wrote with the hashtag, #rogerstonedidnothingwrong.