Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The last of two federal judges has approved a revised settlement in lawsuits that accused the New York Police Department (NYPD) of illegally surveilling Muslims in the wake of the Sept. 11, 2001, terrorist attacks.

Judge Pamela K. Chen of New York’s Eastern District signed off on the agreement Monday, which puts measures in place to protect Muslims and others from NYPD investigations into political or religious activity.

Muslim community members and supporters march near 1 Police Plaza to protest the New York Police Department surveillance operations of Muslim communities on Nov. 18, 2011, in New York. Bebeto Matthews / AP file

The settlement requires the appointment of a civilian representative to ensure the safeguards are followed. That person will be able to relay concerns to the court at any time, and the mayor needs judicial approval to eliminate the position after the initial five-year-period, according to the agreement.

RELATED: New York Reaches Revised Settlement for Post-9/11 Muslim Surveillance Lawsuits

The City of New York will also pay roughly $1.67 million to plaintiffs in one of the suits to cover attorneys’ fees, costs, and expenses. And it will remove a controversial report entitled “Radicalization in the West” from the NYPD’s website, according to court filings.

Former federal Judge Stephen Robinson will serve as the civilian appointee, the mayor’s office announced in a statement. Robinson previously sat on the bench of New York’s Southern District and also served as U.S. attorney for Connecticut between 1998 and 2001.

“Judge Robinson has spent his career working to ensure Americans are treated equally and justly under the law, and I know he shares this administration’s commitment to transparency and fairness,” New York City Mayor Bill de Blasio said in a statement.

But the Muslim Democratic Club of New York expressed concern over how Robinson was chosen.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

"Yesterday, we were severely disappointed to hear of NYC Mayor Bill de Blasio's unilateral appointment of Judge Stephen Robinson to the role of independent civilian monitor—a decision made with no input from impacted communities nor New Yorkers at large, whom Judge Robinson is tasked with representing in his role," the organization said in a statement Wednesday.

Judge Charles S. Haight of New York’s Southern District initially rejected a settlement reached last January, saying the role and powers of the civilian appointee didn’t go far enough.

RELATED: Judge Rejects NYPD Muslim Surveillance Settlement, Pushes for Stronger Protections

Haight is the judge in a decades-old class action lawsuit establishing guidelines for collecting intelligence during activities, including political and religious ones, protected by the First Amendment. In that case, Handschu v. Special Services Division, the NYPD was accused of violating a consent decree in investigating Muslims.

A separate federal lawsuit in 2013, Raza v. City of New York, alleged that the NYPD violated the U.S. and New York constitutions by “singling out and stigmatizing entire communities of New Yorkers based on their religion,” according to the New York Civil Liberties Union (NYCLU), one of the groups involved in the suit.

An excerpt of court documents detailing the settlement.

Imam Hamid Hassan Raza was one of the plaintiffs who accused the NYPD of spying on New York’s Muslim community.

Last week, Haight signed off on a revised agreement in his case, followed by Chen who did the same on Monday for the Raza lawsuit.

In addition to appointing a civilian representative to the NYPD’s internal committee, the settlement bans investigations where race, religion, ethnicity, or national origin is a “substantial or motivating factor” and prohibits open-ended investigations, according to the NYCLU.

Among other things, it also imposes limits on the NYPD’s use of undercover and confidential informants, and mandates “articulable and factual information” before the department begins a preliminary investigation into political or religious activity, the group said.

The civilian representative is required to report to the court annually and also if systematic violations have occurred, court papers said. The appointee can also review the use of undercover officers and confidential informants and how investigations are conducted, not just started or extended.

The Handschu guidelines, named after one of the plaintiffs, will be updated to reflect those changes.

Following the Sept. 11 terrorist attacks, the city applied to remove restrictions and oversight from the Handschu guidelines. The court granted the city's request in 2003. Haight was the judge in that case, according to the Associated Press, as well as the one who signed off on the guidelines in 1985.

The NYPD disbanded a unit in 2014 that spied on Muslims after 9/11.

Corporation Counsel Zachary W. Carter praised Robinson as de Blasio’s choice for NYPD civilian representative.

“We are pleased with this appointment and with the formal resolution of these cases by the Court,” Carter said in a statement.

Attorneys in the Raza lawsuit also welcomed the settlement.

“Now New York Muslims and all New Yorkers will have strong protections from unconstitutional religious profiling and surveillance,” their statement reads. “This agreement sends a critical message to the federal government and police forces around the country that law enforcement can and must do its job without resorting to discrimination.”

Follow NBC Asian America on Facebook. Twitter, Instagram and Tumblr.