Pennsylvania’s highest court has overturned the sexual assault conviction for Bill Cosby, who has served more than two years of a three- to 10-year sentence at a state prison near Philadelphia. In the ruling on Wednesday, the 7-member Pennsylvania Supreme Court said Cosby had been denied a fair trial in 2018.

The 83-year-old actor was accused of drugging and molesting Andrea Constand, a Temple University employee, in 2004, USA Today reported. He was charged in 2015 when a prosecutor presented newly unsealed evidence and arrested him days before the 12-year statute of limitations expired.

When the jury deadlocked, the judge allowed one other accuser to testify at the first trial. The judge then allowed five other accusers to testify at the retrial, giving them a chance to talk about their experiences with Cosby in the 1980s.

Lawyers said prosecutors provided vague evidence about the uncharged conduct, including the actor's own recollections in his deposition about giving women alcohol or drugs before sexual encounters.

“The presumption of innocence just didn’t exist for him,” Attorney Jennifer Bonjean told the court in December.

Cosby, who was the focus of the first high-profile sexual assault trial which unfolded in the aftermath of the #MeToo movement, will now walk free, The New York Times reported

The once beloved TV star was denied paroled after refusing to participate in sex offender programs during his stay in prison. Cosby has continually asserted his innocence while serving time. He became eligible for parole for the first time this year. 

Prosecutors said the star used his fame and “family man” persona to manipulate young women. They also accused him of betraying the survivors after presenting himself as a mentor. 

Prosecutors didn't immediately say if they would appeal the latest decision.