President Donald Trump has signed an executive order on policing to encourage better practices and establish a database to keep track of officers with a history of excessive use-of-force complaints.

President Trump stressed the need for higher standards and commiserated with mourning families, even as he hailed the vast majority of officers as selfless public servants and held his law-and-order line, while also criticising Democrats.

“Reducing crime and raising standards are not opposite goals,” he said before signing the order flanked by police.

President Trump and the Republicans have been rushing to respond to the mass demonstrations against police brutality and racial prejudice that have raged for weeks across the country in response to the deaths of George Floyd and other black Americans.

It is a sudden shift for the Republican Party — and one Democrats are watching warily — that shows how quickly the protests have changed the political conversation and pressured Washington to act.

But President Trump, throughout the crisis, has continued to emphasise his support for law enforcement, and even on Tuesday railed against those who committed violence during the largely peaceful protests.

President Trump’s executive order would establish a database that tracks police officers with excessive use of force complaints in their records.

And it would give police departments a financial incentive to adopt best practices and encourage co-responder programmes, in which social workers join police when they respond to non-violent calls involving mental health, addiction and homeless issues.

President Trump said that, under a new credentialing process, chokeholds will be banned “except if an officer’s life is at risk”.

Chokeholds are already largely banned in police departments nationwide.

President Trump framed his plan as an alternative to the “defund the police” movement that has emerged from the protests and which he slammed as “radical and dangerous”.

“Americans know the truth: Without police there is chaos. Without law there is anarchy and without safety there is catastrophe,” he said.

President Trump’s audience included police officials and members of Congress, and came after he met at the White House with the families of men and women who have been killed in interactions with police.

“To all of the hurting families, I want you to know that all Americans mourn by your side,” he said. “Your loved ones will not have died in vain.”