Alfred Chestnut, Ransom Watkins and Andrew Stewart are released after prosecutor’s office finds errors in the case.

Three men incarcerated for 36 years in Maryland have been exonerated over the killing of a Baltimore teenager after a review of their case.

Alfred Chestnut, Ransom Watkins and Andrew Stewart were released from custody on Monday, hours after a judge cleared their convictions and prosecutors dropped the charges. They were teenagers when they were sentenced to life in prison in 1984.

“On behalf of the criminal justice system, and I’m sure this means very little to you gentlemen, I’m going to apologise,” Circuit Court Judge Charles Peters told the men, the Baltimore Sun reported.

At a press conference following the release of the three black men, Watkins said: “This should have never happened.”

“Somebody’s got to pay for this,” he said. “You can’t just leave this like this. This fight is not over.

On behalf of the criminal justice system... I'm going to apologise Charles Peters, Circuit Court Judge

“When I got the information, I cried, and I didn’t know how to stop crying until a friend of mine came to me and hugged me and said, ‘Man your journey is coming to an end,’ but it is not, my journey is just beginning, because I got to learn how to live right now,” Stewart told local media.

Chestnut, Watkins and Stewart were arrested on November 1983 for the slaying of 14-year-old DeWitt Duckett. The teenager was accosted over his Georgetown jacket and shot in the neck while walking to class at a Baltimore school.

It was the first fatal shooting of a student in a Baltimore public school and drew widespread press attention at the time.

“These three men were convicted, as children, because of police and prosecutorial misconduct,” Baltimore State’s Attorney Marilyn Mosby said.

“What the state, my office, did to them is wrong,” Mosby said. “They deserve so much more than an apology. We owe them real compensation – and I plan to fight for it.”

‘Detectives targeted the three men’

In a statement, the state’s attorney office said “detectives targeted the three men, all 16-year-old black boys, using coaching and coercion of other teenage witnesses to make their case”.

The case was reopened earlier this year by the office of Baltimore City State’s Attorney Mosby after Chestnut sent a letter to the Conviction Integrity Unit. The Washington Post reported Chestnut included exculpatory evidence he uncovered last year.

During examinations the Baltimore prosecutor’s office found errors in the investigation and the new review concluded that a different student, who was 18 at the time of the crime, was the shooter.

One student saw him flee the scene and dump a gun as police arrived at Harlem Park Junior High School but authorities at the time focused their investigation on the trio.

The new suspect was shot to death in 2002.

An assistant prosecutor working on the case told the court in 1984 that the state did not have any reports that would have raised doubts about the defendants’ guilt even though police records had statements involving the 18-year-old and also showed trial witnesses had failed to identify the teenagers in photo lineups.

A judge sealed those documents but Chestnut obtained them through a public records request last year.

“Everyone involved in this case – school officials, police, prosecutors, jurors, the media, and the community – rushed to judgment and allowed their tunnel vision to obscure obvious problems with the evidence,” said Shawn Armbrust, executive director of the Mid-Atlantic Innocence Project, which represents Watkins.

Armbrust added that “this case should be a lesson to everyone that the search for quick answers can lead to tragic results”.

According to the state’s attorney’s office, six wrongfully convicted men have previously been released following investigations involving the Conviction Integrity Unit.