Martin Shkreli apologized for a bizarre Facebook post about Hillary Clinton‘s hair that threatens to land him in jail.

Shkreli’s mea culpa was attached to a letter his lawyer sent a judge asking her to to revoke the $5 million bond of the bombastic ”pharma bro.”

And it came just 24 hours before Wednesday’s scheduled hearing on a request by prosecutors to revoke his bond.

Shkreli, 34, last week encouraged followers of his Facebook page to grab samples of Clinton’s hair from her head and said he would pay them $5,000 per sample.

The post sparked an inquiry from the U.S. Secret Service – and led federal prosecutors to ask Judge Kiyo Matsumoto to jail Shkreli as a potential danger to the community.

Prosecutors noted that Shkreli pulled this latest stunt just weeks after being convicted of three securities fraud-related counts in Brooklyn federal court.

Last week, Shkreli took a very different stance toward prosecutors.

In Facebook post, he wrote: ”F— the government. I will never kiss their ring or snitch. Come at me with your hardest because I haven’t seen anything impressive yet.”

Last month, Shkreli was found guilty of three counts of securities fraud but acquitted of five other criminal counts related to hedge funds investors and a drug company he founded.

Read Shkreli’s letter:

Read the letter from Shkreli’s lawyer: