New York City Mayor Bill de Blasio addresses members of the New York City Police Department Critical Response Command anti-terrorism unit as it gathered for its first deployment outside headquarters on Randall's Island in New York City, Nov. 16, 2015. Reuters

The city will appoint an independent monitor to review the New York Police Department's counterterrorism efforts, the New York Times reported Thursday. Court documents filed Thursday said at least some of the oversight taken away after the 9/11 attacks on the city would be restored.

After the attacks, when leaders said oversight should be rolled back to conduct investigations with more flexibility, the department started to build files on Muslim neighborhoods, recording religious sermons and documenting the license plates of people at those sermons. New York officials have denied any wrongdoing, and the NYPD said the agreement’s tenets will mostly codify what has already been put in place, such as not allowing investigations based purely on religion, the Times reported.

The monitor is set to be appointed for a five-year term, and the position could be eliminated after that time by the mayor, but only after a public notice. The reforms announced Thursday come partly from a settlement in the case Raza v. City of New York, brought by the American Civil Liberties Union in 2013 and alleged the NYPD violated U.S. and New York state law in singling out New York communities based on their religion, the ACLU said in a statement Thursday.

“For the first time, this watershed settlement puts much needed constraints on law enforcement’s discriminatory and unjustified surveillance of Muslims,” ACLU National Security Project Director Hina Shamsi said in a statement. “At a time of rampant anti-Muslim hysteria and prejudice nationwide, this agreement with the country’s largest police force sends a forceful message that bias-based policing is unlawful, harmful and unnecessary.”

Ten years after the 9/11 attacks, the NYPD’s counterterrorism efforts were exposed by a series of reports by the Associated Press, which documented police efforts to keep files on Muslims who changed their names when they arrived in the U.S. and monitor where Muslims ate and prayed. The later monitoring program was known as the Demographics Unit, disbanded just two years ago, the Times reported earlier.