The New York Police Department has abandoned a secretive program that dispatched plainclothes detectives into Muslim neighborhoods to eavesdrop on conversations and built detailed files on where people ate, prayed and shopped, the department said.

The decision by the nation’s largest police force to shutter the controversial surveillance program represents the first sign that William J. Bratton, the department’s new commissioner, is backing away from some of the post-9/11 intelligence-gathering practices of his predecessor. The Police Department’s tactics, which are the subject of two federal lawsuits, drew criticism from civil rights groups and a senior official with the Federal Bureau of Investigation who said they harmed national security by sowing mistrust for law enforcement in Muslim communities.

To many Muslims, the squad, known as the Demographics Unit, was a sign that the police viewed their every action with suspicion. The police mapped communities inside and outside the city, logging where customers in traditional Islamic clothes ate meals and documenting their lunch-counter conversations.

“The Demographics Unit created psychological warfare in our community,” said Linda Sarsour, of the Arab American Association of New York. “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.”