The killing of five police officers in Dallas has “touched the soul of the nation”, US Vice-President Joe Biden said, while calling for national unity.
Micah Johnson shot dead the officers during a protest rally on Thursday.
The march was against the killing of black men by police. Similar rallies drew thousands across many US cities on Friday.
Mr Biden said Americans had a duty to stand up against injustice, but that people also needed to support police.
Filling in for President Obama in his weekly radio address, Mr Biden referenced this week’s police killings of Philando Castile in Minnesota and Alton Sterling in Louisiana.
“When an assassin’s bullet targeted the police force in Dallas, it touched the soul of the nation,” he said.
“Those killed and wounded were protecting the safety of those who were peacefully protesting against racial injustices in the criminal justice system.
“Those who were marching against the kind of shocking images we saw in St Paul and Baton Rouge, and have seen too often elsewhere, of too many black lives lost.”
There was an onus, he said, “on all of us to stand up, to speak out about disparities in our criminal justice system, just as it’s on all of us to stand up for the police who protect us in our communities every day.”
Johnson, an African-American who was himself killed during the assault in Dallas, supported black militant groups who encouraged violence against police.
Dallas police chief David Brown said Johnson had told a negotiator that he had wanted to kill white people, especially white police officers, because he was angry about the recent shootings of black men by police.
Mr Brown and US Homeland Security Secretary Jeh Johnson said the gunman appeared to have acted alone, despite initial reports of a number of snipers.
As well as the five police officers killed, another seven were injured. Two civilians were also hurt.
Bomb-making material, rifles and a combat journal were found at Micah Johnson’s home.
Johnson, 25, was killed by remotely detonated explosives that were sent into a car park where he had taken refuge after the shootings.
He was a member of the US Army Reserve from 2009 to 2015 who had served in Afghanistan.
A number of gun attacks involving police officers and civilians have occurred in other parts of the US in the aftermath of the deaths in Minnesota and Louisiana.
- Early on Saturday in Houston, police shot dead a man they said had pointed a gun at officers. Reports said he was black, and police say he was shot a number of times
- In Tennessee, a black army veteran killed a woman and injured three other people, including a police officer, as he opened fire on a motorway on Thursday morning. After his arrest, Lakeem Keon Scott told investigators he was troubled by police violence against African-Americans
- In Missouri on Friday, a police officer was shot from behind after he walked back to his patrol car to check the driving status of a black man who he had stopped. Antonio Taylor, 31, was later arrested but the motive for the shooting is unknown
- In Georgia on Friday, an officer was shot after he responded to a call from a man who said his car had been broken into. Again, the motive is unknown
Protests against the recent police killings took place on Friday in cities including Atlanta, Houston, New Orleans and San Francisco.
Leaders of the Black Lives Matter organization have condemned the Dallas killings but say planned marches, including a “Weekend of Rage” in Philadelphia, will go ahead.
A Black Lives Matter march was also held in London on Friday.