PERHAPS THE most puzzling aspect of New York Mayor Michael Bloomberg’s staunch opposition to any criticism of the New York Police Department’s (NYPD) controversial “stop and frisk” policy is the flippancy with which he dismisses concerns over racial profiling.

The mayor is correct that the policy has been a boon to the city’s safety, but its critics are also justified in concerns about the racial disparity revealed by NYPD statistics. Together, Hispanics and African Americans make up less than a quarter of New York’s population, yet, according to the New York Civil Liberties Union, they account for nearly 90 percent of all stops police officers make, even in predominately white areas.

In response to public outcry and a federal trial, the New York City Council voted for two measures intended to promote transparency and accountability without impeding effective law enforcement. One would have allowed citizens who had been profiled to sue officers in state courts; the other would have installed an inspector general to supervise the NYPD. Mr. Bloomberg vetoed both bills, although his administration has agreed to purge the database containing the names and personal information of those stopped on the street. The mayor dismissed the notion that anything might be wrong with stop and frisk. As he provocatively declared last month: “[W]e disproportionately stop whites too much and minorities too little.”

Ultimately, the most unfortunate consequence of Mr. Bloomberg’s refusal to engage with his critics is that transparency and accountability are seen as enemies of effective law enforcement. The two aren’t mutually exclusive. The council’s proposal to allow more lawsuits wasn’t the most constructive approach. But racial profiling is not necessary in successful policing, nor should it be made to seem that way.

Philadelphia offers a useful example. In a city with an African American mayor and police commissioner, stop-and-frisk tactics are practiced with good results — and responsibly. In 2011, almost immediately after civil liberties advocates challenged the police department, city leaders agreed to a variety of safeguards that ensure police officers respect civil rights while aggressively fighting crime. The police department now keeps a database of every stop and frisk, and a court-appointed monitor reviews the policy.

It shouldn’t be impossible, as Mr. Bloomberg would have us believe, to reach a similarly reasonable compromise in New York. His successor might look to Philadelphia for an example of a strong police force that pays civil rights the respect they are due.