NEW YORK (CNN) -

New York City's comptroller Thursday announced the approval of a $40 million civil rights settlement to five black and Hispanic men wrongfully convicted in the horrific beating and rape of a white female jogger in Central Park in 1989.

"In my judgment, this settlement is a prudent and equitable solution for all parties to the lawsuit and closes a very difficult chapter in our City's history," comptroller Scott Stringer said in a statement.

The settlement has to be submitted for approval to Judge Deborah Batts of the U.S. District Court in Manhattan, where the men filed their civil rights lawsuit.

Michael Warren, a lawyer for three of the men -- Kevin Richardson, Antron McCray and Raymond Santana Jr. -- said his clients were thrilled with the agreement, which will be formally announced at a news conference on the steps of City Hall on Friday.

"We're not only elated but very relieved that this process has advanced to the point where these young men can finally begin to move on with their lives," Warren told CNN.

The settlement closes a dark episode in recent New York City history. The sensational case polarized the city along racial lines and became emblematic of rampant crime. Five minority teenagers, who became known as the Central Park Five, said they were coerced into making incriminating statements, and they were convicted in 1990.

The agreement between the city law department and the five men -- who served between seven and 13 years in prison -- averages about $1 million per year of incarceration, a source with knowledge of the settlement told CNN.

One of the men, Kharey Wise, served 13 years in prison. Yusef Salaam, Richardson, McCray, and Santana Jr. each served about seven years.

On April 19, 1989, a 28-year-old Wall Street investment banker jogging through Central Park was raped, viciously beaten and left for dead. She would have no memory of the attack.

That same night, a group of black and Latino youths had been in the park, throwing rocks at cars and assaulting people in a practice the media and law enforcement at the time called "wilding."

An investigation led to the arrest of five teens who were accused of rampaging through the park in a "wolf pack" and preying on innocent victims. They were charged and convicted.

"If they had their way," Salaam told CNN in 2012, "we would have been hanging from one of those lovely trees here in Central Park."

The victim, Trisha Meili, kept her identity hidden for 14 years until the publication of her book, "I Am the Central Park Jogger."

"I guess there are lots of theories out there but I just don't know and it's almost too confusing for me to understand," she told CNN in 2003, referring to the false confessions given by the five men. "I've had to come to peace with it by saying: 'You know what? I'm just not going to know.'"

Three of the convicted young men had finished their prison terms, one was on parole and the fifth was in jail on an unrelated offense when Matias Reyes, a serial rapist and murderer in 2001 confessed to the crime and said he had acted alone.

"After being exonerated, it's like somebody running free through the...grass and throwing their hands up and yelling, 'Ah!' you know ... the feeling is overjoy and happiness," Salaam told CNN.

DNA analysis later determined that Reyes was the perpetrator of the rape, and that hair evidence used in the boys' trials did not match.

Robert M. Morgenthau, the Manhattan district attorney at the time, ordered a new investigation and, on his recommendation, a judge vacated the convictions.

A civil rights lawsuit filed by the five men accused police and prosecutors of false arrest, malicious prosecution and a racially motivated conspiracy. The administration of former mayor Michael Bloomberg fought the case, but his successor, Bill de Blasio, pledged to settle the suit before taking office.