New York’s law prohibiting loitering for the purpose of prostitution has been challenged as unconstitutional and for allegedly being enforced by the New York City Police Department in a discriminatory way.

The Legal Aid Society of New York City and Cleary Gottlieb Steen & Hamilton contended in a Southern District lawsuit, D.H. v. City of New York, that the statute, state Penal Law §240.37, is unconstitutionally imprecise on its face because it allows police officers to decide what kinds of activities constitute “loitering” by suspects.

The complaint, filed Friday, also alleges that the law impermissibly allows officers the discretion of deciding if a suspect’s clothing was provocative enough to signal that he or she was attempting to solicit customers for prostitution.

In addition, the complaint contends that New York City police have enforced the loitering statute in a way that discriminates against minorities, women and transgender suspects. The suit alleges that between 2012 and 2015, nearly 70 percent of the arrests under §240.37 were in five predominately black or Hispanic precincts of New York City.

Violations under §240.37 are misdemeanors punishable by up to one year in jail.

Lead attorneys on the suit are Kate Mogulescu of the Legal Aid Society and Rishi Zutshi of Cleary Gottlieb.

The New York City Law Department did not immediately return a call seeking comment Friday.