U.S. Attorney General William Barr said that if communities do not show more respect to law enforcement officers, they may lose "police protection."

Barr made the comments, which have drawn criticism from some liberal groups and commentators, at an award ceremony Tuesday honoring officers and deputies for "distinguished service in policing," USA Today reports.

In his speech, Barr compared being in law enforcement to being in the military during and immediately after the Vietnam War.

Barr said Americans need to focus on "the sacrifice and the service" of law enforcement.

"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 might find themselves without the police protection they need."

In August, Barr told the Fraternal Order of Police that there must be "zero tolerance for resisting police," and in the same speech, criticized "district attorneys that style themselves as 'social justice' reformers."