US President Barack Obama on Saturday tried to unify a fractured nation, insisting the shock shootings in Dallas and simmering racial tensions would not derail a common sense of purpose.
Obama lamented a "painful" week, in which five police officers were gunned down during a protest against the police killings of black Americans, but he rejected comparisons with the civil unrest of the 1960s.
"I firmly believe America is not as divided as some have suggested," Obama told a press conference at a NATO summit in Warsaw.
"There is sorrow, there is anger, there is confusion... but there is unity. This is not who we want to be as Americans."
Obama has said he will cut short his foreign trip and visit Dallas next week after a black extremist opened fire on officers protecting a peaceful march against police brutality.
Thousands of protesters marched in US cities late Friday, with many remembering the slain officers, but anger remains over the deaths of Alton Sterling in Louisiana and Philando Castile in Minnesota, two African-American men killed by police.
While acknowledging the need to heal divisions, Obama played down talk of wider unrest.
"When we start suggesting that somehow there's this enormous polarization and we're back to the situation in the 60s and -- that's just not true," Obama said.
"You're not seeing riots, you're not seeing police going after people who are protesting peacefully."
Obama pointed out that crime was now substantially lower and that US society had stronger foundations to build on than half a century ago.
Obama said Dallas shooter Micah Johnson, 25, who was killed in a standoff with police, was "demented" and did not represent African Americans.
"The demented individual who carried out the attacks in Dallas, he's no more representative of African Americans than the shooter in Charleston (in South Carolina) was representative of white Americans," Obama said.
Dylann Roof, 22, is accused of gunning down nine African American churchgoers in Charleston last year. Prosecutors in his case have said they will seek the death penalty if he is convicted.
Obama added that it was difficult to untangle Johnson's motives.
While the White House has ruled out any link between the gunman and known "terrorist organizations," Johnson's Facebook page ties him to several radical black movements listed as hate groups.
Obama meanwhile said he was going to keep discussing race issues and gun control in the wake of a series of mass killings.
He denied politicizing the gun control debate in the wake of the Dallas shootings and said he had to deal with the issue, despite its polarizing effect.
"If you care about the safety of our police officers, then you can't set aside the gun issue and pretend that that's irrelevant," he said.
"When it comes to the issue of gun safety, there is polarization. Between a very intense minority, and a majority of Americans who actually think that we could be doing better when it comes to gun safety," he said.
"We're going to have to tackle that at some point. I'm not going to stop talking about it. Because if we don't talk about it we're not going to solve these underlying problems. It's part of the problem."