A judge on Tuesday cleared the way for the release of a man who has spent 28 years behind bars for a rape he says he did not commit, setting bond that will allow the prisoner to walk free.

Clarence Moses-EL was convicted in 1988 after the victim said his face appeared to her in a dream, but a judge vacated his conviction last week after another inmate said he had sex with the woman.

Moses-EL has long maintained his innocence, and his case inspired legislation requiring preservation of DNA evidence in major felony cases for a defendant's lifetime after police threw out body swabs and the victim's clothing.

The judge on Tuesday set bail at $50,000, and supporters said they posted the money they had raised. Moses-EL was expected to be formally released from custody later in the day.

Moses-EL was sentenced to 48 years in prison in the attack against a woman after she returned home from a night of drinking. When police initially asked who assaulted her, she named the man who later confessed.

More than a day later, while in the hospital, the woman identified Moses-EL as her attacker, saying his face came to her in a dream.

Moses-EL's efforts to appeal his conviction have been unsuccessful, and the legal and political system repeatedly failed Moses-EL in his decades-long attempt to win his freedom.

An appeals court rejected his case. Moses-EL later won a legal bid for DNA testing on the evidence to clear his name, but Denver police threw it away, saying they didn't see any notice from prosecutors to hold on to it.

In 2008, the governor, a former Denver prosecutor, objected to legislation that would have given him a retrial and received widespread support from lawmakers.

Moses-EL's break came when L.C. Jackson, who the victim had initially identified as her rapist, wrote to Moses-EL in 2013 saying he had sex with the woman that night. Jackson has not been charged in this case but remains imprisoned for two other rapes in 1992.

Despite the challenges, one of Moses-EL's attorneys said she has never seen him angry.

"He has always fully believed that he would someday get out," Keyonyu O'Connell said.

The Denver District Attorney's Office has not decided whether to prosecute Moses-EL again but reserved a trial date in June should they choose to do so.