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

NEW YORK — A judge jailed former pharmaceuticals company CEO Martin Shkreli on Wednesday after finding that he violated his bail on a securities fraud conviction with a social media posting she agreed posed a threat to Hillary Clinton.

Defense attorneys had argued at a hearing in federal court in Brooklyn that the post by Shkreli, offering a $5,000 bounty to anyone who could grab him one of Clinton's hairs while she's on a book tour, was political satire. But U.S. District Judge Kiyo Matsumoto didn't see the humor, saying the offer could be taken seriously by fellow Clinton detractors.

The Clinton offer could be viewed as "a solicitation of an assault," the judge said before revoking Shkreli's $5 million bail.

"This is not protected by the First Amendment," the judge said. "... There's a risk that somebody may take him up on it."

This Aug. 4, 2017, photo shows defense attorney Benjamin Brafman with former pharmaceutical executive Martin Shkreli after the jury issued a verdict at the U.S. District Court for the Eastern District of New York. Drew Angerer / Getty Images

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

The government had told the judge that the message had alarmed the Secret Service detail that protects Clinton, a Democratic former presidential candidate and first lady. It also argued that it fit a pattern of veiled threats against female journalists who rebuffed Shkreli's social media advances and of taunts aimed at prosecutors in his case.

On Wednesday morning, Shkreli, often called the Pharma Bro, wrote to the court apologizing for his behavior, saying, "I am not a violent person."

But for the judge, it was too little, too late.

"He doesn't have to apologize to me," she said. "He should apologize to the government, the Secret Service and Hillary Clinton."

Shkreli watched in silence as the hearing unfolded and sometimes put his head down and appeared to scribble notes. After the judge's ruling, he remained expressionless as deputy U.S. marshals led him out a side door of the courtroom without handcuffing him.

The government sought to get Shkreli locked up as a danger to the community amid the fallout from his social media post, which read: "The Clinton Foundation is willing to KILL to protect its secrets. So on HRC's book tour, try to grab a hair from her. I must confirm the sequences I have. Will pay $5,000 per hair obtained from Hillary Clinton."

The defense insisted it was merely a tasteless joke comparable to some of President Donald Trump's derisive comments.

"Indeed, in the current political climate, dissent has unfortunately often taken the form of political satire, hyperbole, parody or sarcasm," the defense's court papers said. "There is a difference, however, between comments that are intended to threaten or harass and comments — albeit offensive ones — that are intended as political satire or strained humor."

Shkreli, who is best known for hiking up the price of a life-saving drug and for trolling his critics on social media, was found guilty last month on charges, unrelated to the price-fixing scandal, that he cheated investors in two failed hedge funds he ran. The defense had argued that investors got their original investments back and even made hefty profits.

Shkreli faces up to 20 years in prison at sentencing, set for Jan. 16.