When Shamel Capers, 24, shuffled into a crowded Queens courtroom on Thursday, he was still a convicted murderer, his hands shackled to a thick leather belt as three court officers stood close by.
But his festive green three-piece suit seemed to hint at an impending celebration.
Mr. Capers had been behind bars since his arrest at age 16 for a murder that he always insisted he never committed.
After eight years in prison, his conviction was set to be vacated after the discovery of exonerating evidence.
Mr. Capers declined to comment in the courtroom, but when Justice Michelle A. Johnson finally threw out his conviction, he bowed his head briefly and slowly rose to his feet, towering above his lawyer, Winston Paes.
An investigator unshackled him and unclasped the binding leather belt. The court officers stepped back, and one said to Mr. Capers’ lawyers and relatives, “He’s all yours.”
For Mr. Capers, it was his first taste of freedom since age 16 when he was arrested on a charge of killing a 14-year-old honors student, D’aja Robinson, a year earlier when he was only 15.
D’aja was killed in May 2013 after being hit by crossfire in a gang dispute while on a city bus after leaving a party in Jamaica, Queens.
Mr. Capers was convicted largely on the testimony of a gang member who said he saw Mr. Capers fire bullets at the bus.
After being sentenced to 15 years to life in prison, he got to work immediately on trying to prove his innocence from inside prison, he said on Thursday, standing outside the courtroom and looking almost intimidated by the prospect of freedom.
Several years ago, Debevoise & Plimpton, a Manhattan law firm, agreed to handle his appeal pro bono after being alerted to the case by Getting Out Staying Out, which advocates for formerly incarcerated young men.
“Because of his insistence upon his innocence, we decided to investigate the case,” said Mr. Paes, a lawyer with Debevoise.
The firm began interviewing witnesses and found a troubling element in the case. The main witness against Mr. Capers had been offered a significant sentence reduction on several unrelated felonies in exchange for his testimony.
Mr. Capers was not arrested until a year after the shooting, for which an acquaintance, Kevin McClinton, had already been arrested. A new eyewitness told authorities that he saw Mr. Capers fire the first few shots into the bus before Mr. McClinton took the gun and continued firing.
That witness, Lael Jappa, was facing multiple unrelated charges and was pressured into falsely implicating Mr. Capers, Mr. Capers’ lawyers said. His account became the primary evidence linking Mr. Capers to the shooting.
Mr. Jappa would later recant to a defense investigator, a recantation that was corroborated by recorded phone calls from Rikers Island in which he admitted to his mother in 2014 that he never saw Mr. Capers shoot at the bus.
The Debevoise lawyers approached the Queens District Attorney’s Conviction Integrity Unit, which spent two years interviewing dozens of witnesses, including Mr. Jappa, who again recanted his testimony to them.
Queens County District Attorney Melinda Katz said that, given the new evidence, “we could not let miscarriages of justice stand.”
“For there to be justice in the criminal justice system, and public faith in its outcomes, it is incumbent upon us as prosecutors to follow the facts to wherever they lead,” she said.
The Debevoise team said in a statement that misconduct by Queens prosecutors and New York City detectives helped lead to Mr. Capers’ wrongful conviction, including the pressuring of Mr. Jappa.
The Police Department did not respond to request for comment.
A spokesman for Ms. Katz said that the prosecutors in Mr. Capers’ case were no longer working in the district attorney’s office.
The spokesman, Frank Sobrino, said that 13 convictions have been vacated by the office’s Conviction Integrity Unit since Ms. Katz created it after taking office in 2020. He added that Ms. Katz has had 60 criminal cases thrown out because of misconduct by three detectives.
In the hearing on Thursday, Bryce Benjet, director of the integrity unit, said the recantation was “the kind of thing we treat with deep scrutiny.”
Some relatives of D’aja, the shooting victim, appeared in court to signify their opposition to the exoneration.
Justice Johnson addressed them, noting that she understood the “loss and emotional turmoil” in having to revisit the case. But, she added, “a court’s decision must be grounded in fact, not emotion.”
The city has paid millions in recent years to settle wrongful conviction and incarceration lawsuits. Problematic eyewitnesses are one of the most common causes of wrongful convictions.
Last month, the city agreed to pay $26 million to settle lawsuits filed on behalf of two men whose convictions in the 1965 assassination of Malcolm X were thrown out in 2021.
And in July, a state court judge cleared the three men wrongfully convicted of causing a deadly fire at Brooklyn subway token booth.
Mr. Capers walked out of the courtroom on Thursday, hugged his mother in the hallway and then walked coatless out into the chill of Queens Boulevard. He seemed to welcome the cold.
“I just want to get back to my family,” he said.
Mr. Capers also said he wanted to bring attention to a “broken justice system” and help the many wrongfully convicted people still in prison.
“There’s a lot of guys — the list goes on forever,” he said.