The five men whose convictions in the brutal 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 in the sensational crime.

The agreement, reached between the city’s Law Department and the five plaintiffs, would bring to an end an extraordinary legal battle over a crime that came to symbolize a sense of lawlessness in New York, amid reports of “wilding” youths and a marauding “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 who is not a party in the lawsuit but was 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. The story quickly exploded into the public psyche, fanned by politicians and sensational news reports that served to inflame racial tensions.