NEW YORK (Reuters) - A divided New York State Court of Appeals, the state’s highest court, on Thursday threw out the indictment of a man who spent more than six years in the Rikers Island jail in a Manhattan murder case, saying his constitutional right to a speedy trial was violated.

The 4-3 decision favoring Reginald Wiggins came less than a month after the federal appeals court in Manhattan dismissed on speedy trial grounds the indictment of an upstate man, Joseph Tigano, held for nearly seven years before being convicted on marijuana charges.

Wiggins was 16 when he was charged in the May 2008 shooting death of a 15-year-old boy, who was a bystander outside a “Sweet Sixteen” party on West 90th Street in Manhattan, by a shot meant for a guest.

But he waited in jail as the Manhattan District Attorney’s office spent more than five years trying first to win testimony against him from a co-defendant, who then went through three mistrials.

Wiggins finally pleaded guilty to manslaughter in September 2014, before a fourth trial could start, and was sentenced to 12 years in prison. The co-defendant, Jamal Armstead, later pleaded guilty to attempted murder.

Writing for Thursday’s majority, Judge Eugene Fahey said prosecutors cannot indefinitely delay trials to gather evidence, and delays such as Wiggins’ erode faith in the “fundamental fairness” of the criminal justice system.

Even if prosecutors acted in good faith, “their decision to pursue a strategy for Armstead’s cooperation that continued to be unsuccessful after five years cannot justify that extraordinary delay,” Fahey wrote.

Chief Judge Janet DiFiore dissented. She said five years was “an extensive amount of time, even for a murder case,” but prosecutors made “diligent efforts” to move forward and Wiggins “apparently acquiesced” in some of the delay.

Now 26, Wiggins has been imprisoned at the Green Haven correctional facility, about 65 miles (105 km) north of Manhattan.

“A 16-year-old kid was held at Rikers Island for over six years without a trial,” said Ben Schatz, a lawyer for the nonprofit Center for Appellate Litigation, who handled Wiggins’ appeal. “We’re glad the court saw this as a violation of his constitutional right to a speedy trial.”

A spokesman for Manhattan District Attorney Cy Vance said that office disagreed with the decision, and that some of the delay was “beyond the parties’ control.”

Officials including New York City Mayor Bill de Blasio have been working on a timeline to close Rikers Island, which has been marred by overcrowding and reports of violence.

The case is People v Wiggins, New York State Court of Appeals, No. 15.