MANILA (Reuters) - Police have been forced to stop conducting drug surveys and testing in the Philippine capital’s biggest and most populous area after a lawyers’ group representing residents filed a petition before a court, a police chief said on Tuesday.

Slideshow ( 3 images )

Thousands of residents had been surveyed and a few hundred had been tested in a door-to-door anti-narcotics campaign in two communities in Manila’s Quezon City from May this year, part of President Rodrigo Duterte’s bloody war on drugs.

Human rights groups and Duterte’s political opponents have said tests conducted by police amounted to harassment that could endanger the lives of those who tested positive. Activists say large numbers of users have been killed during the anti-drug campaign, often by mysterious gunmen.

Community officials were still allowed to go around the city’s 142 neighborhoods asking people to complete surveys about drug use and take voluntary urine tests, said Guillermo Eleazar, Quezon City police chief.

“The police will no longer have an active role in the anti-drug activities,” Eleazar told Reuters, a day after he attended a court hearing on a petition to stop the police tests.

“Our uniformed personnel will now be limited to providing security and visibility upon the requests of our barangay (community) officials. They will no longer take part in asking questions and taking urine samples,” he said.

The decision comes as Philippine police are under intense media scrutiny over their conduct in an anti-narcotics campaign that has killed thousands of Filipinos over the past 15 months and alarmed human rights monitors.

Activists and some opposition politicians have accused Duterte of having a kill policy that aims to eliminate suspected drug dealers rather than take them into custody.

Duterte and the police reject such accusations and say that those killed had resisted arrest violently.

Eleazar said the drug tests police had conducted were voluntary and not coercive.

He said the court did not issue a restraining order because he assured the judge it was up to each community to decide its own programmes and police would play only a supporting role.

Eleazar accepted some police officers were “over-zealous” in the conduct of house-to-house surveys and tests, but said petitioners were wrong to blame police, who were only trying to help.

“The petitioners are barking up at the wrong tree,” he said. “They should ask the court to stop the barangays from doing these anti-drug surveys and tests.”

The National Union of People’s Lawyers (NUPL) said they expected police to shift blame.

“No doubt this about-face by the police was due to public protests and the legal suit,” the NUPL said in a statement.