Twenty years ago, Derrick Hamilton was at his lowest point: locked in solitary confinement for a murder he insisted he did not commit. Over the next two decades, he slowly crawled his way out of the belly of the beast.

He became a jailhouse lawyer, helping his fellow inmates appeal their convictions. Twenty-three years later, he finally persuaded prosecutors to throw out his own conviction, after an eyewitness recanted her testimony. Once free, he became an activist, toiling to get others he believed were wrongfully convicted out of jail.

Late last week, Mr. Hamilton, 54, took on a new role in the long drama of his fight against injustice: a successful plaintiff. City officials in New York and New Haven, Conn., agreed on Friday to pay him a total of $7 million to settle a lawsuit he had filed against three police officers, accusing them of fabricating evidence against him.

One of those officers, Louis Scarcella, a retired New York detective, has emerged in recent years as symbol of wrongful convictions, as numerous cases he handled have fallen apart. Under the terms of the agreement, reached on the eve of what would have been a trial in Federal District Court in Brooklyn, Mr. Scarcella admitted no wrongdoing. He had been scheduled, like Mr. Hamilton himself, to testify at the trial.