Four men and a woman who spent nearly 20 years in prison after being wrongfully convicted in two Bronx murder cases have agreed to settle their Manhattan federal court lawsuits against New York City for $40 million, according to court filings and the city.

The five — Eric Field, Devon Ayers, Michael Cosme, Carlos Perez and Cathy Watkins — were convicted of killing a livery driver in 1995, and Ayers, Cosme and Perez were also convicted of what prosecutors alleged was the related murder of an executive. A sixth man convicted in the second case settled previously.

They were all cleared based on information from two cooperating witnesses identified by the Manhattan U.S. attorney’s office, and their convictions were vacated in 2012. All five filed federal civil rights lawsuits.

advertisement | advertise on newsday

Two of the five have only reached agreements in principle to settle. If they become final, all five would receive $8 million, with the total figure just shy of the settlement of federal claims agreed to by the five men wrongfully convicted in the Central Park Jogger case.

“These suits were brought by people who together spent nearly one hundred years in prison,” said a statement by the city’s Law Department, which called the settlements “fair and in the best interests of the city.”