WASHINGTON — Attorney General William Barr drew some fire on Wednesday for saying that if the nation's communities don't show police the kind of support and respect the military gets, they might find themselves without the protection they need.

The ACLU said Barr was telling communities to bow their heads to the police, and a former head of the Justice Department's Civil Rights Division called the remarks dangerous.

But a Justice Department official said the attorney general was not suggesting that police would abandon their duties without public support and was instead referring to its importance in maintaining the ability to recruit and retain qualified officers.

During a ceremony to honor police officers, Barr said crowds applaud departing troops and show their approval for individual service members in airports, but police get no cheers when they roll out of the precinct and get no ticker-tape parades when they come home.

In the Vietnam era, he said, the troops who served in that conflict bore the brunt of people opposed to the war.

"The respect and gratitude owed them was not given, and it took decades for the American people to realize that," Barr said. It's good to see troops today getting the proper recognition, he added.

"But I think today the American people have to focus on something else, which is the sacrifice and the service that is given by our law enforcement officers. And they have to start showing, more than they do, the respect and support that law enforcement deserves. And if communities don't give that support and respect, they might find themselves without the police protection they need."

Civil rights groups were quick to respond.

"Support and respect are earned, not given as the result of a demand from those who carry badges and guns," said Jeffrey Robinson of the ACLU. "Attorney General Barr is telling communities across the country to bow their heads in respect to police even if those same police are violating their rights and killing people without justification."

Vanita Gupta, who headed the Civil Rights Division under President Barack Obama, said, "The idea that the attorney general of the United States, the nation’s chief law enforcement officer, is recommending abandoning communities as retribution for pushing for police reform or criticizing policing practices, is profoundly dangerous and irresponsible."