Chopper 6 was overhead as Cosby gave a peace sign to cameras before walking into his Elkins Park, Pennsylvania home.
Cosby was sentenced in September 2018 to three to 10 years in state prison for allegedly drugging and sexually assaulting former Temple University employee Andrea Constand in 2004. Cosby has served a little less than two years of his sentence.
Last year, the Pennsylvania Supreme Court agreed to hear two points in Cosby's appeal to overturn his 2018 sexual assault conviction.
In a ruling released Wednesday, the state Supreme Court concluded that Cosby's prosecution should never have occurred due to a deal the comedian cut with former Montgomery County prosecutor Bruce Castor, who agreed not to criminally prosecute Cosby if he agreed to give a deposition in a civil case brought against him by Constand.
During that deposition, Cosby made incriminating statements that Castor's successor, Kevin R. Steele, used to charge Cosby in 2015.
SEE ALSO: Bill Cosby leaves prison after court overturns sex assault conviction
Castor is the same lawyer who went on to represent former President Donald Trump during the ex-president's second impeachment trial earlier this year.
"The discretion vested in our Commonwealth's prosecutors, however vast, does not mean that its exercise is free of the constraints of due process," the Pennsylvania Supreme Court justices wrote in their 79-page decision.
"When an unconditional charging decision is made publicly and with the intent to induce action and reliance by the defendant, and when the defendant does so to his detriment (and in some instances upon the advice of counsel), denying the defendant the benefit of that decision is an affront to fundamental fairness, particularly when it results in a criminal prosecution that was foregone for more than a decade," the justices wrote.
The decision went on to say Cosby was the victim of an unconstitutional "coercive bait-and-switch."
“His heart was racing, he couldn’t believe it.” Family spokesperson Andrew Wyatt detailing when @BillCosby learned he was a FREE man. @6abc #billcosby https://t.co/nRmMGfJtcT pic.twitter.com/1I6sr8QjoK— Christie Ileto (@Christie_Ileto) June 30, 2021
Believing he had immunity from criminal prosecution, Cosby testified during four days of depositions by Constand's attorneys, and the civil lawsuit was settled for more than $3 million in 2006.
"As a practical matter, the moment that Cosby was charged criminally, he was harmed: all that he had forfeited earlier, and the consequences of that forfeiture in the civil case, were for naught," the justices wrote.
Cosby cannot be retried on the criminal charges.
SEE ALSO: Bill Cosby conviction overturned: Timeline of events leading to actor's release
"He was found guilty by a jury and now goes free on a procedural issue that is irrelevant to the facts of the crime," Steele said in a statement Wednesday afternoon.
Steele commended 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."
"My hope is that this decision will not dampen the reporting of sexual assaults by victims," Steele said. "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."
Attorney Gloria Allred represented several women who testified at Cosby's trial to bolster the prosecution's evidence of "prior bad acts" against the entertainer and to prove a pattern of practice.
"Despite the Pennsylvania Supreme Court's decision, this was an important fight for justice," Allred told ABC News Live. "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."
SEE ALSO: DA: Cosby's release is "irrelevant to the facts of the crime"
Janice Baker Kinney, one of the women who testified at Cosby's criminal trial alleging that he sexually assaulted her in 1982 when she was a 24-year-old bartender in Reno, Nevada, told ABC News Live on Wednesday she was "stunned" by the news.
"I'm shocked, and my stomach's kind of in a knot over this," Kinney said. "Just one little legalese can overturn this when so many people came forward, so many women have told their truths."
In an appeal of the conviction, Cosby's lawyers argued that the trial judge erred in allowing Cosby's prior deposition about using quaaludes during consensual sexual encounters with women in the 1970s.
Two lower courts, including a three-judge panel of Pennsylvania Superior Court jurists, had previously refused to overturn the comedian's conviction.
Despite the deluge of accusations against him, Cosby has maintained he never engaged in non-consensual sex.
ABC News contributed to this report.