Police Commissioner Ray Kelly — furious over cops showing up at crime scenes wearing sometimes offensive precinct T-shirts — has banned even off-duty officers from sporting anything with an NYPD logo without prior approval.

“The department wants to deter the unprofessional appearance associated with many of these unauthorized police-related logos or slogans,” said NYPD spokesman Paul Browne.

No particular shirt caused offense, added a top police source. But “they were popping up in greater numbers, and some of them at crime scenes,” said the source.

Some of taboo shirts’ slogans included the 81st Precinct’s “Bed Stuy do or die’’ and a shirt popular with homicide detectives that says, “Our day begins when your day ends.”

The sweeping order, issued on Jan. 19, says officers are “prohibited” from wearing “any item of apparel which contains a department logo or shield or in any way identifies wearer with the New York City Police Department unless approved by the Uniform and Equipment Review Committee.”

The order applies to any “member of the service, uniformed or civilian, on or off duty.”

Some cops love to wear their special-logo shirts — several of which include a small NYPD shield on them — showing pride in their commands or precincts.

But some shirts have caused offense — such as one worn by some cops in Harlem that dubs the 30th Precinct the “House of Pain.”

Others disliked by brass include one that calls the 32nd Precinct in Hamilton Heights the “Tomb of Gloom.”

Kelly’s edict sparked outcry among the rank and file.

“Some of us are proud to be cops,” said one incredulous officer. “What? We can’t wear a T-shirt saying NYPD?”

But a police higher-up suggested that there would be leeway in the new rule, saying, “Common sense is going to apply here.’’

Pat Lynch, president of the Patrolmen’s Benevolent Association, called the order “patently unlawful” and “a clear violation of the officers’ free-speech rights,”

Additional reporting by David Seifman