After more than three weeks in custody, As I Lay Dying frontman Tim Lambesis was released from a San Diego County jail on Thursday afternoon after posting $2 million bail in a murder-for-hire case.

The 32-year-old singer was arrested on May 7 after police alleged he tried to hire a hit man named Red to kill his estranged wife, Meggan. Red turned out to be an undercover police officer, and Lambesis was arrested after prosecutors claim he gave the officer an envelope that contained $1,000 cash, a picture of his wife and the code to her security gate.

Two days after his arrest, Lambesis pleaded not guilty to the solicitation of murder charge.

Prosecutors wanted a $20 million bail for the singer after Meggan told the judge she feared for her life, according to CBS 8 News. His bail was eventually set at $3 million, but in a hearing last week, a judge in the case agreed to cut it down to $2 million.

In that same hearing, Lambesis' lawyer, Thomas Warwick, said that at the time his client allegedly tried to hire the hit man, his judgment was "devastatingly" impaired by steroid use. (The singer was an avid body builder and was a spokesman for nutritional supplements).

According to U-T San Diego, the singer must stay away from his wife and children and will have to surrender his passport.

Lambesis is due back in court for a preliminary hearing June 10. He could face up to nine years in prison if convicted.