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."
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.
Also Read
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.
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.
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.