In 2018, Cosby was convicted of drugging and sexually assaulting a woman.
Bill Cosby will soon walk out of prison a free man. On Wednesday, the Pennsylvania Supreme Court overturned the 83-year-old's 2018 conviction for drugging and sexually assaulting Andrea Constand in 2004, according to court documents obtained by ET.
According to the docs, the court found that an agreement Cosby had with a previous prosecutor prevented him from being charged in the case. Cosby previously said that he relied on that agreement before agreeing to testify in his accuser's civil lawsuit.
"When a prosecutor makes an unconditional promise of non-prosecution, and when the defendant relies upon that guarantee to the detriment of his constitutional right not to testify, the principle of fundamental fairness that undergirds due process of law in our criminal justice system demands that the promise be enforced," the docs read.
"Cosby provided Constand's civil attorneys with evidence of Cosby's past use of drugs to facilitate his sexual exploits," the docs noted. "Undoubtedly, this information hindered Cosby's ability to defend against the civil action, and led to a settlement for a significant amount of money. We are left with no doubt that Cosby relied to his detriment upon the district attorney's decision not to prosecute him."
The court also ruled that Cosby's case cannot be prosecuted again, writing, "He must be discharged, and any future prosecution on these particular charges must be barred."
"We do not dispute that this remedy is both severe and rare," the docs continued. "But it is warranted here, indeed compelled."
In a statement to ET, District Attorney Kevin R. Steele said, "The majority decision by the Pennsylvania Supreme Court orders the release of William H. Cosby Jr. from state prison. He was found guilty by a jury and now goes free on a procedural issue that is irrelevant to the facts of the crime. I want to commend Cosby’s victim Andrea Constand for her bravery in coming forward and remaining steadfast throughout this long ordeal, as well as all of the other women who have shared similar experiences. My hope is that this decision will not dampen the reporting of sexual assaults by victims. Prosecutors in my office will continue to follow the evidence wherever and to whomever it leads. We still believe that no one is above the law -- including those who are rich, famous and powerful."
Cosby was initially charged in the case in 2015. He was acquitted during his first trial in 2017. The next year, during Cosby's retrial, he was convicted of all three felony sex-assault counts.
Prior to his conviction being overturned, Cosby, who has maintained that his encounter with Constand was consensual, had served more than two years of his three to 10 year prison sentence. He was denied parole in May.
Last June, the Pennsylvania Supreme Court agreed to review Cosby's case. At the time, the court said it'd review the trial judge's decision to allow other women to testify about alleged previous encounters with Cosby. In addition, the court agreed to examine Cosby's agreement with a former prosecutor.
Shortly after Cosby won the right to appeal, his wife, Camille Cosby, expressed support for her husband's appeal.
"There are possibilities now. Finally, there is a court … that has said, 'Wait a minute. There are some problems here. They can be considered for appeal,'" Camille told ABC News. "I am very, very pleased … but now I'm looking at something that is possible. Possible for vindication. That is the goal."
RELATED CONTENT: