Martin Shkreli, the brash pharma entrepreneur who is awaiting sentencing for fraud, is to be sent to jail after a judge ruled he presented a danger to the community because of threatening behaviour towards Hillary Clinton.

Shkreli, convicted last month but free on a $5m bail bond, had offered a $5,000 bounty in a Facebook post to anyone who could “grab a hair” from Mrs Clinton’s head during the former presidential candidate’s book tour.

Judge Kiyo Matsumoto said “there has been a danger present through this post” and revoked his bail in court in Brooklyn, New York, after which Shkreli was led away in handcuffs.

Prosecutors had argued that Shkreli’s threatening behaviour had forced the US Secret Service to “expend significant additional resources to ensure” Mrs Clinton’s safety.

The jailing of the 34-year-old is the latest twist in the bizarre tale of Shkreli, who became an international pariah in September 2015 for raising the price of an Aids drug from $13.50 to $750 per pill and appearing to revel in the subsequent outcry.

It never occurred to me that my awkward attempt at humor or satire would cause Mrs Clinton or the Secret Service any distress

At the time Mrs Clinton, then running for president, cited his actions as an example of rampant “price gouging” in the pharmaceuticals sector and promised to stamp out the practice if elected. Shkreli has seen her as something of a nemesis ever since.

A few months after the pricing controversy, he was arrested on unrelated fraud charges and last month was found guilty on three out of eight counts. Following the conviction, Shkreli’s lawyers said they hoped he would avoid jail time given that he had been acquitted on most counts including the most serious.

But the words of his high-profile attorney Ben Brafman on the courthouse steps following the jury’s decision turned out to be prophetic: “The controversy surrounding Martin, God bless him, is sometimes not helpful.”

Shkreli will probably remain in jail until January when he is due to be sentenced.

Prosecutors had asked Judge Matsumoto to order Shkreli jailed after he made disparaging remarks about several women including Mrs Clinton in a string of aggressive social media posts.

Shkreli had argued that the Clinton post was satire and took it down two days after it was put online.

His lawyers said in a court filing that while they did not condone his recent public statements, “his constitutionally protected political hyperbole does not rise to the level of making him a ‘danger to the community’ when he is not and has never before been considered to be a danger”.

Shkreli took the rare step of apologising and sent the court a letter in which he said he was sorry “for the aggravation that my recent postings have caused”.

“It never occurred to me that my awkward attempt at humor or satire would cause Mrs Clinton or the Secret Service any distress,” he wrote in a letter dated September 11.

Shkreli faces up to 20 years in prison when he is sentenced in January although he could serve less under US sentencing guidelines.

Copyright The Financial Times Limited . All rights reserved. Please don't copy articles from FT.com and redistribute by email or post to the web.