A West Philadelphia man who spent 38 years behind bars for a murder he insisted he didn’t commit was released from prison Friday after a judge agreed that his 1984 conviction was marred by weak evidence and a flawed defense.

Larry Walker, 60, walked out of a state prison in Chester and was greeted by a ecstatic throng of family and friends, including his two grown children and several grandchildren. His son lifted him onto his shoulders as the crowd — many wearing shirts referencing his case — hollered and cheered.

Walker, wearing an Eagles shirt, jeans, and fresh white Nike shoes, gathered the group in a circle for a prayer before they left to celebrate.

“My heart is beating so quick,” he said, adding that he was still struggling to process his emotions. “It’s beyond what I expected.”

Earlier in the day, during a Zoom hearing, Common Pleas Court Judge Tracy Brandeis-Roman commended the District Attorney’s Office and Walker’s attorneys and advocates for showing “fortitude, honesty, compromise, and compassion” in working together to scrutinize Walker’s conviction for second-degree murder — which carries an automatic life sentence — and agreeing on a resolution that will secure Walker’s freedom.

Prosecutors said that although they now lack confidence in Walker’s conviction, they were “unable to say with certainty” that he is innocent. Under an agreement they struck with his lawyers, Walker will return to court next month and plead guilty to third-degree murder, receiving no additional prison time.

District Attorney Larry Krasner said doing so was an acknowledgement that even if someone cannot be proven innocent by new evidence, such as DNA, “the jailhouse door has to open when there’s substantial doubt on the charge of conviction.”

Paul Casteleiro, an attorney for Walker who works for Centurion Ministries, an advocacy organization that took up his case, said the arrangement for Walker to plead guilty was “bittersweet” but one he was ready to accept.

“He’s 60 years old and went in as a 22-year-old kid,” Casteleiro said. “He’s ready to be home.”

Prosecutors who reviewed Walker’s case did not allege the type of police or prosecutorial misconduct that has been common in many of the other convictions they’ve deemed worthy of being thrown out.

In a letter to Brandeis-Roman, Assistant District Attorneys Thomas Gaeta and Patricia Cummings cited a “troubling confluence” of circumstances that they believe led to Walker’s guilty verdict, including a narrow investigation that focused only on Walker; questionable trial tactics by Walker’s defense attorney; and the possibility that those considering the evidence at trial may have been improperly swayed by his admission that he’d had a sexual encounter with the victim, Clyde Coleman.

“The potential that this information might inflame biases held by the jury was plain,” Gaeta and Cummings wrote, adding that the judge who sentenced Walker decades ago questioned his ability to earn an early release from prison due to “the homosexual tendency that he has shown.”

(Walker had a longtime girlfriend at the time, and two children, all of whom have supported his fight for freedom).

The District Attorney’s Office said it now believes the evidence in the case was weak — an assertion that even Walker’s trial prosecutor, Richard P. Meyers, has since admitted in letters supporting Walker’s release.

The case hung largely on the testimony of two eyewitnesses who lived next door to Coleman on the 5600 block of Elmwood Avenue in Southwest Philadelphia and saw him struggling with another man on his front step around 9 p.m. on May 2, 1983, before Coleman was shot.

One of the witnesses, Emma Ellis, testified that the intruder resembled Walker. And her son, Victor Hopkins, then 15, identified Walker as the attacker, but only after hesitating on the stand. (Hopkins has stood by his identification of Walker in the years since the trial, including in an interview with The Inquirer in 2016.)

Another witness told police on the night of the slaying that she’d seen three men fleeing the crime scene, and at trial, she testified that Walker was not among them. Police never identified any other suspects.

Gaeta and Cummings said Walker’s trial attorney made several missteps, including having Walker testify that he’d been watching a karate movie on the night of the slaying without investigating whether that recollection was accurate.

Trial prosecutors were able to prove that no such movies had aired on TV until the following week, casting doubt on Walker’s story.

Even as current prosecutors identified those issues and said they lacked confidence in the conviction, they did not explain in court documents why they do not believe Walker is innocent.

Gaeta and Cummings said Coleman’s relatives nonetheless support Walker’s release.

As Walker and his relatives left the prison grounds Friday, passing cars honked in celebration and his supporters laughed and took photos and cried.

His children, meanwhile, said they were struggling to find the words to describe how they felt. They were 3 and 5 years old when he was first imprisoned; each is now over 40.

“It doesn’t seem real,” said Walker’s daughter, Sharena Smith.

His son, Larry Robinson, choked up and shook his head.

“I’m just thankful,” he said. “I’m thankful.”