The New York Police Department will no longer confiscate unused condoms from suspected sex workers to be used as evidence of prostitution, ending a long-standing practice that had been criticized by civil rights groups for undermining efforts to combat AIDS and other sexually transmitted infections.

Under the new policy announced Monday, officers may continue to seize condoms as evidence in sex-trafficking and promotion of prostitution cases, but they will not use them in support of prostitution cases. Critics had said the previous policy amounted to police harassment, and noted that New York City spends more than $1 million a year to distribute free condoms.

A 2010 study by the city’s Department of Health surveyed more than 60 sex workers and found that more than half had condoms confiscated by police. Nearly a third said they had at times not carried condoms because they feared getting into trouble.

Two years later, the group Human Rights Watch interviewed 197 sex workers in New York, Washington, D.C., Los Angeles and San Francisco and found that many limited the number of condoms they carried or went without because they feared police attention. The report concluded that transgender teens, street-level sex workers and immigrants were especially targeted because of their appearance or behavior.

Prosecutors in Brooklyn and Long Island’s Nassau County and in San Francisco decided last year to no longer use condoms as evidence in prostitution cases. Manhattan District Attorney Cyrus Vance applauded the NYPD’s policy change.

Measures to formally abolish the practice across New York state have been introduced in the Legislature for nearly two decades and last year passed the Assembly.

The New York Police Department makes about 2,500 prostitution arrests a year.