"The Clinton Foundation is willing to KILL to protect its secrets. So on HRC's book tour, try to a grab a hair from her. I must confirm the sequences I have," Shkreli said in the since deleted post.

A judge heard arguments about whether the controversial online antics of Shkreli, dubbed the Pharma Bro, were bad enough to put him behind bars and decided to have him taken into custody immediately.

Prosecutors said the posting prompted the Secret Service to use more resources because it ran the risk many of Shkreli's social media followers would think he was serious and that he should await sentencing behind bars.

A defence attorney argued in court papers that Shkreli's offer was merely a tasteless joke comparable to some of US President Donald Trump's derisive comments, not a threat worthy of putting him behind bars.

"Indeed, in the current political climate, dissent has unfortunately often taken the form of political satire, hyperbole, parody or sarcasm," wrote the lawyer, Ben Brafman.

"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 humour."

Post was a 'solicitation of an assault'

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

"This is not protected by the First Amendment," she said.

"There's a risk that somebody may take him up on it."

The Government had told the judge the message had alarmed the Secret Service detail that protects Mrs 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.

Shkreli on Monday wrote to the court apologising for his behaviour, saying: "I am not a violent person."

But for Ms Matsumoto it was too little, too late.

"He should apologise to the Government, the Secret Service and Hillary Clinton," she said

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 US marshals led him out a side door of the courtroom without handcuffing him.

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 defence had argued investors got their original investments back and even made hefty profits.

Shkreli has said he felt "exonerated" despite his conviction and thought there was a "50-50 chance" he would not face any punishment. He chatted with fans on his YouTube channel and sparred with a reporter after last month's verdict.