NEW YORK - The New York Police Department (NYPD) has scrapped a secret unit of plainclothes detectives that ran detailed, invasive spying operations targeting the city’s Muslim communities.

The move was promptly welcomed by civil rights groups, including the Washington-based Council on American-Islamic relations (CAIR).

The NYPD’s surveillance detail eventually led to multiple legal challenges and outrage among citizens, especially the targeted communities already under scrutiny following the September 11, 2001 attacks.

The Demographics Unit, as the surveillance squad was known, drilled into various neighbourhoods both inside and outside the city, analyzing and mapping religious institutions, social clubs, recreational facilities and events, and all-around everyday life.

“The Demographics Unit created psychological warfare in our community,” said Linda Sarsour of the Arab American Association of New York, according to The New York Times.

“Those documents, they showed where we live. That’s the cafe where I eat. That’s where I pray. That’s where I buy my groceries. They were able to see their entire lives on those maps. And it completely messed with the psyche of the community,” Sarsour added.

NYPD Commissioner Bill Bratton and his top staff members met with Sarsour and other advocates last week. She said the department’s intelligence chief, John Miller, said the NYPD did not need a covert team to monitor Muslims in the city, implicating that the unit would not last much longer.

The team of surveillance operatives started its work in 2003, with the help of CIA officer Lawrence Sanchez while he was also working with the NYPD. The unit was later renamed the Zone Assessment Unit. It has been mostly inactive since Bratton – and Mayor Bill de Blasio – took over in January, NYPD spokesman Stephen Davis said.

 “Understanding certain local demographics can be a useful factor when assessing the threat information that comes into New York City virtually on a daily basis,” Davis said.

“In the future, we will gather that information, if necessary, through direct contact between the police precincts and the representatives of the communities they serve.”

The unit’s aim was to understand possible locations and “hot spots” of radicalization where a would-be militant could hide in plain sight. Thus, the squad of about a dozen members could assess possible signs of budding terror plots.

Detectives were encouraged to engage employees of Muslim-owned businesses to “gauge sentiment” about American foreign policy issues and other political issues.

The unit had mapped and photographed common meeting spots for, say, Egyptians to watch soccer or Albanians to play chess.

The spying operations were buttressed by informants that gathered information on Muslim student groups, as well as the actions of Muslim scholars on college campuses.

The unit designated many mosques as suspected “terrorism enterprises,” thus allowing them to collect license plate numbers of any car in mosque parking lots, secretly film anyone attending a service, and record sermons via bugged informants.

Yet despite investigations of mosques that lasted years, the department never levied terror charges against a mosque or Islamic organization. In fact, after years of gathering information, the NYPD admitted the programme not once generated a lead.

The program was exposed by the Associated Press, the American news agency,  in 2011, and violated groups - along with civil rights defenders - have called for its shuttering ever since.

Though the Demographics Unit has been disbanded, it remains to be seen what comes of these programmes. Though former police commissioner Ray Kelly vigorously defended the operations as lawful and a vital protection from terrorist attacks, the unit’s actions came under significant legal scrutiny.

IN a statement, the New York chapter of CAIR welcomed the closing of the NYPD Zone Assessment Unit. “This is an important first step. However, the damage of unconstitutional mass spying on people solely on the basis of their religion has already been carried out and must be addressed. We need to hear from the mayor and NYPD officials that the policy itself has been ended and that the department will no longer apply mass surveillance or other forms of biased and predatory policing to any faith-based community,” the statement added.