Updated

New York's highest court on Tuesday ordered a third trial for a Hudson Valley man who has spent almost two decades in prison after being convicted of raping and murdering a 12-year-old girl.

The Court of Appeals said the judge at Anthony DiPippo's second trial should have allowed evidence about another suspect who knew her, had committed other rapes of hogtied girls in the woods and allegedly made self-incriminating statements to a fellow inmate at a Connecticut prison about Josette Wright's 1994 disappearance.

The top court concluded the defense evidence about Howard Gombert's history of uniquely similar crimes and his purported statements, corroborated in part by outside sources, should have been allowed. The inability to show Gombert was with the girl the day she disappeared was insufficient reason to rule it out.

Judge Leslie Stein wrote that the jury "would be free to discredit" Connecticut inmate Joseph Santoro's testimony. According to his affidavit, Gombert told him Putnam County authorities were "trying to get him for the killing of two girls" in the area, and that "they already convicted some other suckers" in Wright's death.

DiPippo, 40, and Andrew Krivak, 38, were convicted in 1997 of raping and murdering Wright, whose body was found by a hunter a year after she disappeared. DiPippo's first conviction was overturned because his initial attorney had previously represented Gombert and had failed to investigate him.

DiPippo was convicted at a second trial in 2012, which the top court overturned Tuesday.

"He adamantly has protested his innocence all the time, and I certainly believe him," his appeals attorney Mark Baker said Tuesday. The ruling refines case law for allowing the accused to implicate someone else, he said.

Krivak, also in prison, isn't directly affected by the ruling.

The credibility of the chief witness against both men, who testified she watched the crimes while drinking and smoking marijuana with them, Wright, and two other men in a van, was attacked at trial. She implicated them only after two years, when warned by police she could face charges, Stein wrote.

Calls to Putnam County prosecutors weren't immediately returned.

Judges Eugene Pigott Jr., Jenny Rivera and Shela Abdus-Salaam agreed with the ruling.

Judge Eugene Fahey dissented, saying the court was for the first time allowing a theory of third-party guilt to go forward based on proof "consisting entirely of hearsay."