These should be the glory days for Ray Kelly. His years as New York police commissioner—13 in all and the last 11 since 2002—have seen crime rates plunge, the murder rate hit a historic low, and several foiled terror plots since 9/11 but no successful attack. The last time the city felt this safe, the Dutch were raising cattle at the bottom of Manhattan.

So why are Mr. Kelly and his officers suddenly under ferocious political assault?

"The police department has sort of become a piñata in this mayoral race," he says with matter-of-fact candor on a recent visit to the Journal's offices. "Their goal is to see who can get as far to the left as possible because they see that as the key to winning the primary. A small number of people and groups control the Democratic primary."

The liberal candidates—there is no other kind in these parts—are whacking with particular gusto at a police tactic called "stop-and-frisk." The practice involves stopping people who behave suspiciously, questioning them and, if they appear to present a threat, frisking them to see if they're carrying a weapon. The accusation is that this age-old police tactic unfairly targets minorities.

Surveying the current Democratic candidates, Mr. Kelly explains their basic campaign strategy: "You suck up to a special-interest advocacy group." One such group is the Center for Constitutional Rights, which is suing the NYPD in federal court to stop stop-and-frisk.