The Pennsylvania Supreme Court overturned Bill Cosby’s 2018 sexual assault conviction Wednesday following an appeal by the actor-comedian’s legal team.

Cosby was in the midst of serving the third year in his three-to-10-year prison sentence following his conviction on three counts of indecent aggravated assault against Andrea Constand. He is expected to be released from prison Wednesday.

After the Cosby legal team’s initial attempts to appeal the conviction — citing multiple trial errors and alleging that Cosby was denied a fair trial and improperly convicted — were rejected by the three-judge Pennsylvania Superior Court in December 2019, his lawyers took the appeal to the state’s Supreme Court in January 2020.

The focus of the appeal was the decision to allow the testimony of five other women who claimed Cosby had drugged and sexually assaulted them to be entered as evidence. (Although Cosby was only charged with the drugging and assault of Constand, he faced sexual assault allegations from dozens of women, most of whom accused him of attempting to drug them before sexually assaulting them.)

In the appeal, Cosby’s lawyers argued that the court applied that rule “so expansively as to strip an accused of the presumption of innocence and relieve the prosecution of its burden of proof by permitting a jury to hear, and base its verdict on, dissimilar and inflammatory, decades-old propensity evidence concerting allegations of prior sexual assaults from multiple accusers.”

The Pennsylvania Supreme Court reversed the Superior Court decision and agreed with Cosby’s lawyers, saying that additional testimony tainted the trial, the Associated Press reported. Additionally, the Pennsylvania Supreme Court also uncovered an agreement Cosby made with a previous prosecutor that should have prevented him from being charged in the Constand case.

While Cosby was up for probation this year, he previously stated in an interview that he’d rather serve the entire 10-year sentence than admit guilt. “When I come up for parole, they’re not going to hear me say that I have remorse. I was there. I don’t care what group of people come along and talk about this when they weren’t there. They don’t know,” Cosby said in 2019.