Richard Rosario thought he'd quickly clear himself of suspicion in a New York City killing when he gave police the names of 13 people who could vouch he was in Florida when the shooting happened.

Instead, he was arrested, found guilty and imprisoned for 20 years. He lost multiple appeals.

On Wednesday, a judge overturned Rosario's murder conviction and freed him while prosecutors reinvestigate his 1996 case.

Rosario wiped at his eyes and smiled as Bronx state Supreme Court Justice Robert Torres dismissed the conviction.

"I've been in prison for 20 years for a crime I didn't commit," Rosario told the judge. "My family didn't deserve this. I didn't deserve this, and nor did the family of the victim."

Rosario's attorneys called the case an illustration of unreliable eyewitness testimony, bungled defense and the difficulty of fighting a guilty verdict.

"It really is a case study in a wrongful conviction," said one of his lawyers, Glenn Garber of the Exoneration Initiative. "But he hung in there ... and finally he's getting some level of justice."

Bronx District Attorney Darcel Clark's asked to have Rosario's conviction thrown out but didn't ask to dismiss the charges against him, at least for now.

"We will continue to investigate the murder of George Collazo, who was 16 years old when he was shot and killed, so that his family might have closure," Clark said in a statement Wednesday. "The charges against Mr. Rosario will remain open while we complete the alibi witnesses' interviews and reinvestigate the case in order to decide whether to retry Mr. Rosario."

The decision came two months after Clark succeeded 27-year DA Robert Johnson and days ahead of a planned released of a "Dateline" digital series on NBCNews.com on the case. It adds to a roster of over 25 convictions from New York's high-crime 1980s and '90s that prosecutors have disavowed in the last five years.

"It's a great result. It just should have happened a lot earlier," said another Rosario lawyer, Chip Loewenson.

Rosario, now 40, was arrested after two witnesses identified him from a police photo book as the man who'd shot George Collazo in the head after an exchange of words on a Bronx street on June 19, 1996. No forensic or physical evidence tied Rosario to the crime.

He said he'd been over 1,000 miles away, staying with friends in Deltona, Florida. Once he heard police were looking for him, he listed over a dozen people who'd seen him in Florida.

Police didn't contact those people, according to Rosario's current lawyers. And his own court-appointed attorneys at the time didn't fully explore the alibi witnesses, either.

After phoning the witnesses proved difficult, his initial attorney got a judge's OK to pay to send a private investigator to Florida, but the attorney later acknowledged she never did it. Another lawyer took over before Rosario's trial, mistakenly thought the court had nixed funding for the investigator's Florida trip and didn't pursue it further, according to a 2010 appeals court decision.

The couple who said they'd hosted Rosario testified at his trial and said they had good reason to remember his presence and other details from the day of Collazo's killing: Their first child was born the next day. But the trial prosecutor urged jurors to discount them because of their friendship with Rosario.

During Rosario's appeal, a judge said additional alibi witnesses wouldn't have added significantly to his defense. Rosario's lawyers argue otherwise, noting that some of the witnesses weren't close with Rosario and so might have been more difficult to discredit.