The New York Police Department has disbanded a special unit that tried to detect terror threats in Muslim communities through secret surveillance.

The surveillance program by the NYPD Intelligence Division had come under fire by community activists who accused the department of abusing civil rights, said ABC News. "The program relied on plainclothes officers to eavesdrop on people in bookstores, restaurants and mosques. The tactic was detailed in a series of stories by The Associated Press and became the subject of two federal lawsuits," ABC News reported.

In a series of articles that began in August 2011, the AP documented that police had systematically spied on Muslim neighborhoods, listened in on sermons, infiltrated colleges and photographed law-abiding residents as part of a broad effort to watch communities where terror cells might operate. Individuals and groups were monitored even when there was no evidence they were linked to terrorism or crime.

The investigation revealed that then-police Commissioner Ray Kelly had brought in a CIA official to help develop an intelligence division unlike that of any other U.S. police department. It assigned people called rakers to ethnic neighborhoods, infiltrating enterprises ranging from booksellers to cafes, and people called mosque crawlers to Muslim houses of worship, ABC News reported.

The tactics disclosed by the series stirred debate over whether the NYPD was infringing on the civil rights of Muslims and illegally engaging in religious and ethnic profiling. Hundreds of Muslims staged rallies to protest the spying, and the disclosures prompted more than a dozen religious leaders to boycott then-Mayor Michael Bloomberg's annual interfaith breakfast.

The AP's reporting also prompted an investigation by the CIA's inspector general. That internal inquiry concluded that the CIA, which is prohibited from domestic spying, hadn't broken any laws, but criticized the agency for allowing an officer assigned to the NYPD to operate without sufficient supervision, ABC News reported.