US comedian Bill Cosby has left prison hours after his sexual assault conviction was overturned by Pennsylvania’s Supreme Court.
The judges said there had been a “process violation” by the prosecution but admitted their ruling was unusual.
Mr Cosby, 83, had served more than two years of a three to 10-year sentence at a state prison near Philadelphia.
In 2018 he was found guilty of drugging and molesting ex-basketball player Andrea Constand.
Cosby is best known for starring in the 1980s TV series The Cosby Show and was once known as “America’s Dad”.
Dozens of women had publically accused him of sexual assault, although he was only tried criminally for the incident against Andrea Constand. His conviction in 2018 was widely seen as a landmark moment in the #MeToo movement.
However in 2015 a new prosecutor filed charges after testimony from a civil lawsuit brought by Andrea Constand against the actor was revealed.
“There is only one remedy that can completely restore Cosby to the status quo ante. He must be discharged, and any future prosecution on these particular charges must be barred”, the 79-page finding reads.
“We do not dispute that this remedy is both severe and rare. But it is warranted here.”
In their decision, the judges also found that testimony from accusers unrelated to the case had tainted the trial.
In a first trial, which failed to reach a verdict in 2017, one accuser was called to testify. However in the second trial five women were brought to testify about their experiences with Mr Cosby in the 1980s.
Actor Phylicia Rashad, who played his wife in the The Cosby Show sitcom wrote on Twitter: “A terrible wrong is being righted- a miscarriage of justice is corrected!”