During a speech in which he condemned those who disrespect cops, Attorney General Bill Barr on Monday denounced the “prancing punks” who doused NYPD cops with water.

“We were all nauseated by the spectacle of prancing punks pelting New York police officers with water and plastic buckets. Unfortunately, these were not isolated events. From 2014 through 2017, there has been a 20 percent increase in assaults against police, up to about 60,000 per year,” Barr said at the National Fraternal Order of Police conference in New Orleans.

Several people have been busted in the Big Apple this summer for dousing cops with water.

Barr then praised police officers for the job they do.

“To my mind, there is no more noble profession than serving as a police officer. You put your own life and well-being on the line to protect your communities,” the nation’s top law enforcement official said.

“Your families spend anxious nights, so we can sleep in peace. You never know what your day may bring — what uncertainty, danger, or threat you might face. But you still get up, put on your uniform and badge, kiss your loved ones, and head out to face whatever risks might come your way.”

Police officers, he added, were “fighting an unrelenting, never-ending fight against criminal predators in our society. While there are battles won and lost each day, there is never a final resolution — a final victory is never in sight.”

He said cops get no respect.

“Whenever there is a confrontation involving the use of force by police, they automatically start screaming for the officers’ scalps, regardless of the facts,” Barr said.

“The anti-police narrative is fanning disrespect for the law. In recent years, we have witnessed increasing toleration of the notion that it is somehow okay to resist the police,” he said.

“Previously, it was well understood that, regardless of the circumstances, physical resistance is unacceptable because it necessarily leads to a spiral of escalating violence that endangers the safety of the officer, the suspect, and all in the vicinity. For that reason, virtually all jurisdictions have made resistance a serious crime,” he said.

He also in part blamed the media and “civic leaders” for the turnaround.

“Not too long ago, influential public voices — whether in the media or among community and civic leaders — stressed the need to comply with police commands, even if one thinks they are unjust.

“‘Comply first’ and, if you think you have been wronged, ‘complain later,’” was standard operating procedure, he explained.

“But we don’t hear this much anymore. Instead, when an incident escalates due to a suspect’s violent resistance to police, that fact is usually ignored by the commentary. The officer’s every action is dissected, but the suspect’s resistance, and the danger it posed, frequently goes without mention,” he said.

“We need to get back to basics. We need public voices, in the media and elsewhere, to underscore the need to ‘Comply first, and, if warranted, complain later.’ This will make everyone safe,” he added, saying there should be “zero tolerance for resisting police.”

Barr then slammed some unnamed local prosecutors for being soft on crime — making police officers’ jobs even harder.

“There is another development that is demoralizing to law enforcement and dangerous to public safety. That is the emergence in some of our large cities of district attorneys that style themselves as ‘social justice’ reformers, who spend their time undercutting the police, letting criminals off the hook, and refusing to enforce the law,” he asserted, seemingly singling out American cities.

“These cities are headed back to the days of revolving-door justice. The results will be predictable: more crime; more victims,” he warned.

He praised law enforcement efforts during the administrations of Ronald Reagan, Bill Clinton and George W. Bush — but slammed ex-President Barack Obama while praising his own boss, President Trump.

“Unfortunately, in the last few years of the Obama administration, the violent crime rate started rising again. Days after his inauguration, President Trump issued an executive order with two clear directives,” he said.

“First, he declared that this administration would reduce crime in America. Second, he directed the Department of Justice to take the lead on federal actions to support law enforcement efforts nationwide … to restore public safety to all of our communities.”

But, he added, more work needs to be done.

“Crime levels are still too high and we must keep up a full-court press. In the weeks ahead, we will be doubling down on our attack on violent crime. We will be expanding our efforts against gun violence and violent gangs,” Barr said.

He also singled out Mexican drug cartels for feeding the US’ insatiable demand for illegal drugs.

“We must destroy these cartels,” Barr said.