Attorney General William Barr gave a heated speech about being tough on crime to the Fraternal Order of Police (FOP) this week. FOP is the US's largest fraternal police organization.

After praising the bravery of officers, Barr went on to say public figures in the media and elsewhere should "underscore the need to 'comply first, and, if warranted, complain later.'"

"And those who resist must be prosecuted for that crime," Barr added. "We must have zero tolerance for resisting police. This will save lives."

His comments come when law enforcement is under heightened scrutiny in the US over allegations of systemic brutality and bigotry in some communities.

Barr singled out prosecutors, whom he criticized for being "social-justice reformers" and soft on crime.

Visit BusinessInsider.com for more stories.

The US Attorney General William Barr delivered an emotionally charged speech defending law enforcement this week to the Fraternal Order of Police, or FOP, for its 64th Biennial Conference in New Orleans. FOP is the US's largest fraternal police organization.

"To my mind, there is no more noble profession than serving as a police officer," Barr said. "You put your own life and well-being on the line to protect your communities."

He added: "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."

But Barr went on to say that police officers are "fighting a different type of war ... an unrelenting, never-ending fight against criminal predators in our society."

Read more: FBI agents are livid that Trump is amplifying 'bulls--- theories' about Epstein's death 'that have no basis in reality'

"Even in a healthy society, violence, lawlessness, and predation lie just below the surface," the attorney general said. "In the final analysis, what stands between chaos and carnage on the one hand, and the civilized and tranquil society we all yearn for is the thin blue line of law enforcement. You are the ones manning the ramparts — day in, and day out."

After telling the crowd that "we need to get back to basics," Barr said that public figures in the media and elsewhere should "underscore the need to 'comply first, and, if warranted, complain later.'"

"This will make everyone safe — the police, suspects, and the community at large," he said. "And those who resist must be prosecuted for that crime. We must have zero tolerance for resisting police. This will save lives."

Barr's comments come at a time when the police are under heightened scrutiny in the US on several fronts. In particular, the law-enforcement community has faced criticism over allegations of systemic brutality and bigotry in some communities.

Read more: The El Paso shooting has reignited a debate over whether the federal government has a double-standard when it comes to white-nationalist terrorism

Barr took over as attorney general in February and has long championed a "tough on crime" approach, similar to that espoused by President Donald Trump.

During his speech Monday, Barr singled out local prosecutors for being soft on crime and accused them of making police officers' jobs more difficult.

"There is another development that is demoralizing to law enforcement and dangerous to public safety," he said. "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."

Barr went on to praise the law-enforcement efforts made under the administrations of former Presidents Ronald Reagan, Bill Clinton, and George W. Bush, but criticized Barack Obama, before going on to lavish praise on Trump.

But he added that more work still needs to be done and pledged to "double down on our attack on violent crime."