On Friday, Philadelphia Common Pleas Court Judge Rose Marie DeFino-Nastasi agreed to drop all charges against Jahmir Harris, 31, after eight years in prison for a brazen murder prosecutors now say he did not commit.

But, for an exoneration with agreement from both the District Attorney’s Office and defense, it was an unusually contentious hearing. DeFino-Nastasi did not extend an apology to Harris for his wrongful conviction, nor express clear support for the view that he was innocent.

Instead, she admonished Patricia Cummings, chief of the District Attorney’s Conviction Integrity Unit, for her handling of the case, calling her theory pointing to an alternate suspect “unsubstantiated” and her filings “utterly inappropriate” and designed to “harass and influence the court.”

Philadelphia District Attorney Larry Krasner said his staff, including Cummings, take their ethical responsibilities seriously. “We are required to stand for the truth. I feel that is what we’ve done in this case,” he said.

He said his Conviction Integrity Unit has become a nationally recognized model, handling 19 exonerations so far. “In every case, a judge has signed off and endorsed what we were doing, including this judge today,” he said. But, he added, “I’m also not surprised to see that the leader of the Conviction Integrity Unit and an office that represents change are going to be lightning rods on occasion for hostility for institutions that are not quite as ready for change.”

» READ MORE: Accused of 6 murders, Philly man spent 25 years on death row. Now, his record is cleared.

Harris — who was released from Curran-Fromhold Correctional Facility on Friday night — had been convicted of killing 45-year-old Louis Porter in the crowded parking lot of an Oregon Avenue Walgreens, firing off 17 bullets as shoppers came and went and Porter’s 5-year-old son waited in the back seat.

But the case against Harris hinged on the testimony of a single eyewitness, who saw the killer’s face only for a few seconds and gave different statements about whether there were one or two shooters.

After his lawyer, Michael Wiseman, appealed to the Philadelphia District Attorney’s Conviction Integrity Unit, prosecutors reviewed the case and made a startling discovery: Not only was Harris likely innocent, but evidence contained in the police homicide file pointed to an alternate suspect, they said.

Cell phone records also showed Harris was miles away from the crime scene, on a call with his mother, when the shooting occurred.

Harris did have a troubling tie to the victim: He sold Porter fake Percocet not long before his death. Porter, in turn, resold them, and was consequently dealing with unhappy customers. Harris’ mother, Tammy Harris, testified at his trial that she knew Porter because they grew up in the same neighborhood. She said Porter had called her for help, telling her, “he needed the money because his life was threatened because he owed someone else the money.” She testified she told Porter she’d come up with as much of the $3,900 as she could. Later that day, Porter was killed.

When the Conviction Integrity Unit reviewed the file, though, it found a folder marked “Miscellaneous.” It contained ample evidence pointing away from Harris and toward a different man, whose name The Inquirer is not publishing as he has not been charged. The file contained notes about rental car records and cell phone records that implicated that suspect, thought to be the angry buyer of Porter’s fake drugs.

Based on that review, DeFino-Nastasi agreed to vacate Harris’ conviction on Jan. 19, citing the trial prosecutor’s failure to disclose relevant information. But, until Friday, she had declined to accept the district attorney’s request to drop the charges, ordering prosecutors to provide evidence of a more thorough investigation and to show that Harris and the alternate suspect had not colluded in the slaying.

Last week, Cummings filed an objection accusing the judge of overstepping. “The direct consequences stemming from this Court’s actions and refusal to act are the continued incarceration of Harris for a crime he is likely innocent of and [a situation that] may potentially impact the integrity of any future prosecution.”

» READ MORE: Police shot a Philly man, then accused him of rape. He was exonerated after 19 years.

At Friday’s proceeding, conducted by Zoom, DeFino-Nastasi excoriated Cummings in a 20-minute speech from the bench, before tersely delivering her ruling. She expressed a lack of confidence in the district attorney’s investigation.

“This court wonders how the Commonwealth felt confident in releasing a murder suspect from prison when the Commonwealth said one page earlier that the criminal investigation in this matter was still ongoing.”

After the hearing, Wiseman, Harris’ lawyer, called Tammy Harris, who had been watching the proceeding remotely but was left confused. “She said, ‘What happened?’ I said, ‘Tammy, Jahmir’s coming home today!’ And she just shrieked. It was amazing.”

Wiseman praised the CIU’s work on the case, and said Cummings and her team reflected “the highest integrity, honesty, and diligence of any lawyer I’ve ever worked with.”

In contrast, the work of detectives and prosecutors who locked up Harris in 2015 “at best was negligent. It was bumbling,” he said.

“They literally had the killer in their grasp,” he said, but let him get away.

Louis Porter’s wife of 18 years, Nickole, decided not to attend the hearing, but said in an interview that she remained convinced of Harris’ guilt. She had three children with Porter and all of them have struggled with the trauma, especially the now-13-year-old who witnessed his death.

“The nightmares have finally stopped,” she said. “We just started getting sleep at night, and you’re telling me my husband’s murderer is able to walk the streets? Now what message are you sending to the city?”

In the end, she said, the proceedings shook her faith in the legal system.

“You’re playing tag in court. You’re playing whatever game you’re playing. This is our life.”