U.S. Attorney General William Barr showed a bad grasp of history and modern thinking with his veiled warning to communities not to criticize the police.

His comments last week at an event in Washington, D.C., showed a tin ear to the committed efforts by law enforcement agencies across the nation to improve relations with the communities they serve. They also ignore the Justice Department's own commendable history — especially in the South — of professionalizing local police agencies and bringing them into the modern age.

Barr made his remarks at — of all places — an awards ceremony honoring officers — in part for their success in community policing. He noted that some Vietnam War veterans, upon returning home, bore the brunt of Americans' opposition to the war, and that it took decades for the nation to realize "the respect and gratitude owed them was not given."

Turning to today, Barr likened the criticisms of police to the treatment of those veterans. And he said communities must be more supportive of police or risk losing protection. "They have to start showing, more than they do, the respect and support that law enforcement deserves," Barr said. "And if communities don't give that support and respect, they may find themselves without the police protection they need."

There is no parallel between America's division over Vietnam and protests in some cities today over allegations of police misconduct. The returning veterans were wrongly pilloried for carrying out official government policy. Yet the protests today are directed at specific incidents of outlier behavior by individual officers in distinct cities. To equate the two and to conflate concern over police misconduct with contempt for law enforcement paints a false picture of what's going on.

Police agencies throughout this region and the country have worked for years to build stronger relationships in their communities. They recognize the actions of a single officer can taint an entire force.

Barr's comments also diminish his department's legacy of rooting out corruption and abuse by local law enforcement for decades. The federal government's steady hand has been instrumental in professionalizing local law enforcement, especially during the segregationist period in the South. Even in 2016, the Justice Department helped Tampa recover from its biking-while-black scandal, issuing a series of recommendations that it shared with 17,000 law enforcement agencies across the nation. That's the sense of duty by those in uniform the attorney general apparently missed.