NEW YORK — The five men whose convictions in the 1989 beating and rape of a female jogger in Central Park were later overturned have agreed to a settlement of about $40 million from New York City to resolve a bitterly fought civil-rights lawsuit over their arrests and imprisonment for a crime they did not commit.

The agreement, reached between the city’s Law Department and the men, would end an extraordinary legal battle over a crime that came to symbolize lawlessness in New York, amid reports of “wilding” youths and a “wolf pack” that set its sights on a 28-year-old investment banker who ran in the park many evenings after work.

The confidential deal, disclosed by a person not party to the lawsuit but told about the proposed settlement, must still be approved by the city comptroller and then by a federal judge.

The initial story of the crime, as told by the police and prosecutors, was that a band of young people, part of a larger gang that rampaged through Central Park, had mercilessly beaten and sexually assaulted the jogger.

Unlimited Digital Access. $1 for 4 weeks.

The five black and Hispanic suspects, ages 14 to 16 at the time of their arrests, claimed that incriminating statements they had given had been coerced by the authorities. The statements were ruled admissible, and the five were convicted in two separate trials in 1990.

In December 2002, an investigation by the Manhattan district attorney, Robert Morgenthau, found DNA and other evidence that the woman had been raped and beaten not by the five teenagers but by Matias Reyes, a rapist and murderer who had confessed to acting alone in the attack. Concluding that the new evidence could have changed the original verdict, Morgenthau’s office joined a defense motion asking that the convictions be vacated, and they were.

If approved, the settlement would fulfill a pledge by New York Mayor Bill de Blasio to meet a “moral obligation to right this injustice.”

The proposed settlement averages roughly $1 million for each year of imprisonment for the men. That amount would suggest that the city was poised to pay one of the men, Kharey Wise, who spent about 13 years in prison, more than it has in any wrongful-conviction case. The other four men — Kevin Richardson, Antron McCray, Yusef Salaam and Raymond Santana Jr. — served about seven years in prison.

The lawsuit had accused the city’s police and prosecutors of false arrest, malicious prosecution and a racially motivated conspiracy to deprive the men of their civil rights, accusations the administration of Mayor Michael Bloomberg fought vigorously for more than a decade.