CNN  — 

Bill Cosby was released from prison Wednesday after Pennsylvania’s highest court overturned his sexual assault conviction, saying the disgraced actor’s due process rights were violated.

The stunning decision in the case of the man once known as “America’s Dad” reverses the first high-profile celebrity criminal trial of the #MeToo era.

The panel of Pennsylvania State Supreme Court judges said in their opinion that a former Montgomery County district attorney’s decision to not prosecute Cosby in 2005 in return for his deposition in a civil case was ultimately used against him at trial.

“In light of these circumstances, the subsequent decision by successor D.A.s to prosecute Cosby violated Cosby’s due process rights,” the judges wrote.

Cosby was sentenced in 2018 to 3 to 10 years in a state prison for drugging and sexually assaulting Andrea Constand at his home in 2004.

Cosby, 83, in a white T-shirt, made a brief public appearance outside his Pennsylvania home Wednesday afternoon but did not speak to reporters.

“He is extremely happy to be home,” said Cosby attorney Jennifer Bonjean, who appeared with Cosby and other lawyers. “This has been a hard three years for this entire family. It’s really a blessing for him. He says his heart is beating really fast.”

Cosby tweeted a photo of himself Wednesday night, thanking his supporters.

Cosby served three years in prison

Hours earlier, Cosby was released from a prison outside of Philadelphia and picked up by his press representative. Cosby served three years in prison. His attorney Brian Perry said the comedian and his legal team were headed to his Pennsylvania home to “celebrate.”

“I want to thank the Supreme Court who saw the light and saw the truth,” Cosby’s family said in a statement released by the press representative, Andrew Wyatt.

For victims who sought closure in the case’s resolution, the ruling represented “a slap in the face” in the words of Lisa Bloom, the attorney for three accusers.

Bloom said she thinks it could be “a very hard day” for all the women who accused him of sexual assault.

One accuser, Victoria Valentino, said in a statement: “I am outraged! Outraged! Stunned! My stomach is in knots. The work that we have done to uplift women has been overturned by a legal glitch. We now have a serial predator on the street.”

Gloria Allred, who represented other accusers, said the overturning of the conviction on technical grounds did not vindicate Cosby.

“My heart especially goes out to those who bravely testified in both of his criminal cases. I represented a majority of the prior bad act accusers who testified,” Allred said in a statement.

“Despite the Pennsylvania Supreme Court’s decision, this was an important fight for justice and even though the court overturned the conviction on technical grounds, it did not vindicate Bill Cosby’s conduct and should not be interpreted as a statement or a finding that he did not engage in the acts of which he has been accused.”

Indeed, the Montgomery County district attorney who prosecuted Cosby, Kevin Steele, said the actor was 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,” Steele said.

“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.”

Constand and her attorneys said the decision to vacate Cosby’s conviction is disappointing.

“Today’s majority decision regarding Bill Cosby is not only disappointing but of concern in that it may discourage those who seek justice for sexual assault in the criminal justice system from reporting or participating in the prosecution of the assailant or may force a victim to choose between filing either a criminal or civil action,” Constand and her attorneys said in a statement.

High court judges say ‘remedy is both severe and rare’ but warranted

Judges on the Pennsylvania Supreme Court last December heard arguments that Cosby sat for a civil deposition only because former Montgomery County District Attorney Bruce Castor had promised he would not prosecute him criminally. In that deposition, Cosby admitted that he procured Quaaludes for women he wanted to have sex with.

In their decision Wednesday, the judges wrote that Castor had felt “he would not be able to prove beyond a reasonable doubt that Cosby drugged and raped Constand.”

“Seeking ‘some measure of justice’ for Constand, D.A. Castor decided that the Commonwealth would decline to prosecute Cosby for the incident involving Constand, thereby allowing Cosby to be forced to testify in a subsequent civil action, under penalty of perjury, without the benefit of his Fifth Amendment privilege against self-incrimination,” the judges wrote.

That civil deposition Cosby gave was revealed in 2014, and one of Castor’s successors later used statements he made in the deposition as part of the criminal trial.

The judges wrote that they weighed different remedies – including having another trial for Cosby – but felt there was only one proper remedy.

“He must be discharged, and any future prosecution on these particular charges must be barred,” the judges wrote. “We do not dispute that this remedy is both severe and rare. But it is warranted here, indeed compelled.”

Elie Honig, a CNN senior legal analyst and former federal and state prosecutor, said the only place to appeal an opinion from the Pennsylvania’s highest court is the US Supreme Court.

“There is no way the US Supreme Court will take this case. … The court says you cannot retry him for this particular victim,” he said of Constand. “We know that the statute of limitations has passed for many of these victims.”

Cosby publicist drives him home from prison

Wyatt met Cosby to drive him home from prison.

“Mr. Cosby was originally given a deal by Bruce Castor in which he was granted immunity. He gave up his fifth amendment rights in hopes that he would get back to work, back to life. And he always showed up for any legal matters and questions on his own accord. Charges should never have been brought against Mr. Cosby,” the statement said.

“I want to thank the attorneys who successfully argued his appeal and especially Mrs. Cosby who stood strong and was here for Mr. Cosby every step of the way and supported every idea and strategy from the attorneys and the team and she always knew that Mr. Cosby was innocent.”

Cosby was denied parole in May by the Pennsylvania Parole Board, which cited a number of reasons for its decision, according to a letter from the board obtained by CNN.

The letter said Cosby had to “participate in and complete additional institutional programs.” The board cited Cosby’s “failure to develop a parole release plan” and a “negative recommendation by the Department of Corrections” as factors that contributed to the decision.

Conviction represented remarkable turn of events for disgraced actor

The Cosby case was seen by many as a test of whether the cultural shift the #MeToo movement brought about would translate in court.

Although dozens of women accused Cosby of sexual misconduct, only Constand’s allegations resulted in criminal charges.

Constand initially told police about the assault in 2005, a year after the assault occurred. After Castor decided not to file charges in the case, Constand and Cosby settled a civil lawsuit for $3.38 million in 2006.

In late 2015, when a groundswell of women spoke out with accusations against Cosby, Steele, the new prosecutor in Montgomery County, filed charges.

The case centered on testimony from Constand, a former employee with Temple University women’s basketball team. She testified that Cosby, a powerful trustee at Temple, drugged her and sexually assaulted her when she visited his home to ask for career advice.

Prosecutors had little forensic evidence and relied on the testimony of Constand. In addition, five other women testified that Cosby had drugged and then assaulted them decades ago, as prosecutors sought to prove Cosby’s actions toward Constand were part of a pattern.

The defense team launched aggressive attacks on Constand’s credibility and said their sexual interaction was consensual. Defense lawyers claimed she wanted a piece of Cosby’s fortune.

In April 2018, a jury found Cosby guilty of three counts of aggravated indecent assault. The verdict came a year after Cosby’s previous trial ended in a mistrial, as a different panel of jurors said they were deadlocked and could not unanimously agree on a verdict.

Cosby was a groundbreaking actor and comedian and the first African-American performer to win an Emmy, which was for his role on “I Spy.” He played the sweater-loving Cliff Huxtable on “The Cosby Show,” one of the first mainstream TV shows to feature a Black upper-middle class family.

CNN’s Jean Casarez contributed to this report.