The settlement is also notable for its size: Mr. Collins will receive a little more than $600,000 per year served, about a third less than the five men exonerated in the Central Park jogger case, who settled with the city this summer for about $1 million for each year in prison.

The lawsuit was scheduled to go to trial in October.

Mr. Collins, 42, began fighting his conviction while at Green Haven Correctional Facility, a maximum security state prison, tracking down witnesses who had testified against him and filing Freedom of Information Law requests. He was convicted of fatally shooting the rabbi, Abraham Pollack, as Mr. Pollack was collecting rent in an apartment building in Williamsburg, Brooklyn. At trial, three witnesses said that Mr. Collins had talked about killing the rabbi or placed him at the scene of the crime.

But as Mr. Collins researched the case from prison and contacted the witnesses, he uncovered problems with their stories. One said he had been offered a perk by the district attorney’s office in return for testimony, and two others said they had been threatened by lawyers for the office. Mr. Collins also found that a prosecutor did not turn over potentially exculpatory evidence to the defense.

Mr. Collins tried and failed to obtain a new state trial based on the evidence he had found. He sought a resolution in federal court, and enlisted the help of Mr. Rudin. In 2010, as a judge heard arguments about potential prosecutorial misconduct in his trial, the district attorney’s office agreed to vacate the murder conviction and to not retry Mr. Collins.

The wrongful-conviction settlement is one of several the city has reached this year, including a $6.4 million settlement for David Ranta, a man who spent 23 years in prison for a murder he did not commit. The city is facing several more such lawsuits as erroneous convictions from the crime-ridden 1980s and 1990s continue to be vacated.