One of his lawyers Jennifer Bonjean said: “We are thrilled to have Mr Cosby home. He served three years of an unjust sentence and he did it with dignity and principle and he was a mentor to other people.
“He was doing the time – the time was not doing him.”
She added: “We knew all along he shouldn’t have been prosecuted for this.”
Cosby himself later tweeted: “I have never changed my stance nor my story. I have always maintained my innocence.
More on Bill Cosby
“Thank you to all my fans, supporters and friends who stood by me through this ordeal. Special thanks to the Pennsylvania Supreme Court for upholding the rule of law.”
I have never changed my stance nor my story. I have always maintained my innocence. Thank you to all my fans, supporters and friends who stood by me through this ordeal. Special thanks to the Pennsylvania Supreme Court for upholding the rule of law. #BillCosbypic.twitter.com/bxELvJWDe5
Cosby, who was once beloved as “America’s Dad”, was arrested and charged in 2015 when a prosecutor brought new evidence concerning the alleged 2004 assault days before the 12-year statute of limitations expired.
He was convicted of drugging and sexually assaulting accuser Andrea Constand in 2018 and vowed to serve all 10 years of his sentence rather than acknowledge any remorse.
But Pennsylvania’s highest court said that district attorney Kevin Steele, who made the decision to arrest Cosby, was obligated to stand by his predecessor’s promise not to charge the actor after he gave potentially incriminating testimony in a civil suit brought by Ms Constand.
Justice David Wecht, writing for a split court, said Cosby had relied on the former prosecutor’s promise and that overturning the conviction, and barring any further prosecution “is the only remedy that comports with society’s reasonable expectations of its elected prosecutors and our criminal justice system”.
Andrew Wyatt, spokesman for Cosby, said in a statement: “We want to thank the Pennsylvania Supreme Court, this is what we have been fighting for and this is justice and justice for black America.
“This is justice Mr Cosby has been fighting for. They saw the light.”
However Lisa Bloom, an attorney who represents one of Cosby’s accusers, said the ruling did not mean he was innocent of the charges he was convicted of.
“It’s important to understand that nowhere in the 79-page decision did the Pennsylvania Supreme Court say Bill Cosby is innocent,” she said.
“They did not say that he is exonerated. They did not say that there was insufficient evidence to convict him.
“Instead, they said that he should never have been prosecuted in the first place because a prosecutor many years ago, back in 2005, promised that he would not prosecute him.
“And a subsequent prosecutor then came in and decided to do it. And ultimately, Cosby was convicted. But that was the only reason in the court’s decision and nobody should take this as a finding of innocence.”
Cosby, whose role as Dr Cliff Huxtable in 1980s hit sitcom The Cosby Show made him a national treasure in the US, was originally convicted of drugging and molesting Ms Constand, a Temple University employee, at his estate in suburban Pennsylvania in 2004.
Ms Constand, a former professional basketball player who worked at his alma mater, was one of more than a dozen women who accused Cosby of misconduct but the only one whose case made it to court.
The trial judge allowed just one other accuser to testify at Cosby’s first trial, when the jury deadlocked.
However, at the retrial the judge allowed five other accusers to testify about their experiences with Cosby in the 1980s.
The Pennsylvania Supreme Court said that testimony tainted the trial, even though a lower appeals court had found it appropriate to show a signature pattern of drugging and molesting women.
Cosby was the first celebrity tried and convicted in the #MeTooera. It is thought the overturning of his conviction could have ramifications for other similar cases.
During the trial, prosecutors said Cosby repeatedly used his fame and “family man” persona to manipulate young women, holding himself out as a mentor before betraying them.
Cosby, a groundbreaking black actor who grew up in public housing in Philadelphia, made a fortune estimated at $400m (£290m) during his 50 years in the entertainment industry.
His trademark clean comedy and homespun wisdom fuelled popular TV shows, books and stand-up acts.
In May, Cosby was denied parole after refusing to participate in sex offender programmes during his nearly three years in state prison.
He has long said he would resist the treatment programmes and refuse to acknowledge wrongdoing even if it meant serving the full 10-year sentence.
This is the first year he was eligible for parole.