The city on Thursday agreed to pay $9.9 million to an innocent man who spent 19 years behind bars after being framed by a notorious New York Police Department detective who doubled as killer for the mob.

The settlement for Barry Gibbs set a record for a civil rights lawsuit against the city. The previous high - $8 million - went to a man left paralyzed when he was shot by a police officer in 1999.

"We have agreed to settle this case and believe it is in the best interest of all parties," the city Law Department said in a statement.

In a phone interview, Gibbs said he plans to spend some of the money on medical bills and on his grandchildren's college education.

"I had my freedom taken away from me and now I have it back," Gibbs said. "I'm going to live each day like it's my last."

The wrongful conviction of Gibbs, a 61-year-old one-time postal worker, was a disturbing footnote to the sensational case of former detectives Louis Eppolito and Stephen Caracappa, the so-called "Mafia cops."

The former detectives were convicted in April 2006 and imprisoned for life on charges they moonlighted as professional hit men in the 1980s and 1990s, settling scores against rivals of a Lucchese crime family underboss for tens of thousands of dollars. A jury found Eppolito and Caracappa responsible for eight murders, along with kidnapping and other crimes.

Eppolito had been the lead investigator in the prostitute's 1986 killing. He located a witness who testified at a trial that, while jogging, he had seen Gibbs dump the body of the strangled victim near a bridge.

Gibbs, who at the time was struggling with a drug problem, admitted he once had an "encounter" with the woman but said he never harmed her. Still, he was convicted and sentenced in 1988 to 20 years to life in prison.

Following Eppolito's arrest in the mob killings, Gibbs' lawyers urged federal agents and prosecutors to re-examine his case. The discovery of an old homicide file on the prostitute's killing stashed in the former detective's Las Vegas home raised suspicions further.

Under renewed questioning by the FBI, the witness recanted, claiming Eppolito had bribed and intimidated him into falsely identifying Gibbs. Investigators have speculated the former detective may have been trying to deflect attention away from mobsters who were the actual killers.

The Brooklyn district attorney's office, which prosecuted Gibbs, decided to seek his release in 2005 after it "determined the witness's trial testimony was suspect." Gibbs sued the city for the wrongful conviction in federal court in Brooklyn in 2006.

"I hope he lives another 100 years," Gibbs said Thursday when asked about Eppolito. "Every day in prison is like a day of death. I should know."