SAN FRANCISCO -- President Barack Obama urged Americans rattled by a week of violence and protests to find "open hearts" and new empathy Tuesday in a speech that seesawed between honoring police officers for their bravery and decrying racial prejudice that can affect their work.
Obama stood next to five empty chairs for the white police officers killed last week by a black man seeking vengeance for police killings. Behind him, underscoring his message of unity: Dallas police officers, a racially diverse church choir and local officials who ranged from black Police Chief David Brown to former President George W. Bush, a Dallas resident.
RAW VIDEO: Pres. Obama speaks at Dallas officer memorial
Obama sought to reassure the nation that he understands the impact of the unsettling events of the past week - including the killing of two black men by white police officers as well as the Dallas attacks.
Disturbing videos of the events have "left us wounded and angry and hurt," he said.
"It is as if the deepest fault lines of our democracy have suddenly been exposed, perhaps even widened."
Undaunted, the president urged Americans to cast aside such doubt and replace it with faith in the nation's institutions and progress.
"Dallas, I'm here to say we must reject such despair. I'm here to insist that we are not as divided as we seem. And I know that because I know America. I know how far we've come against impossible odds," he said.
The president spoke steps away from the chairs left empty for the five men killed last Thursday while protecting hundreds of people protesting the killings of black men in Louisiana and Minnesota. The Army veteran killed by police after the Dallas attack said he was motivated by revenge.
RELATED: Bay Area police officers travel to Dallas to honor fallen officers
"The soul of our city was pierced," Mayor Mike Rawlings said, as he welcomed the president and a line of public officials, including Bush, who attended with his wife, Laura, Vice President Joe Biden and his wife, Jill, and Brown. The group on stage capped the ceremony by holding hands and swaying to the "Battle Hymn of the Republic" - a symbol in sight and song of the service's unity theme.
"Too often we judge other groups by their worst examples, while judging ourselves by our best intentions," Bush said. "And this has strained our bonds of understanding and common purpose."
Bush and other speakers paid tribute to the fallen officers - Brent Thompson, a 43-year-old newlywed; Patrick Zamarripa, 32, a Navy veteran who served in Iraq; Michael Krol, 40, an athlete and basketball lover; Michael Smith, 55, a former Army Ranger and father of two, and Lorne Ahrens, whose wife is a police detective.
No one expressed his appreciation for the men more memorably than Brown, who has emerged as the steady and charismatic face of the Dallas police. The chief spent part of his time reciting Stevie Wonder's "I'll Be Loving You Always" to express his affection for his officers.
PHOTOS: Fallen officers remembered at Dallas memorial
For Obama, the moment was a chance to try to defuse what some have described as a national powder keg of emotions over race, justice, gun violence and policing. The president positioned himself as both an ally of law enforcement and a sympathizer of the Black Lives Matter movement.
It's a posture neither side has completely accepted.
Law enforcement officials have sharply criticized Obama and some of his policies, including a decision to stem the flow of military-grade equipment to local departments. One prominent voice, William Johnson, executive director the National Association of Police Organizations, accused Obama of waging a "war on cops."
Some protesters, meanwhile, questioned why Obama rushed home from Europe this week to attend the service in Dallas before meeting with the communities grieving their dead in Minnesota and Louisiana.
In a gesture aimed at the answering that, Obama telephoned members of the families of Alton Sterling and Philando Castile, the men killed in confrontations in Baton Rouge and suburban St. Paul, as he flew to Dallas.
The White House said Obama worked late into the night on his speech, consulting Scripture for inspiration..
After years of delivering emotional pleas for peace at similar memorials, Obama acknowledged his fatigue and the limits of his words on Tuesday.
"I'm not naive," he said. "I've seen how inadequate words can be in bringing about lasting change. I've seen how inadequate my own words have been."
When he has doubts, he said, he remembers a passage from Ezekiel, in which the Lord promised to take "your heart of stone, and give you a heart of flesh."
"With an open heart we can learn to stand in each other's shoes and look at the world through each other's eyes," Obama said. "So that maybe the police officer sees his own son in that teenager with a hoodie, who's kind of goofing off but not dangerous. And the teenager, maybe the teenager will see in the police officer the same words, and values and authority of his parents."
Click here for more information on donating to the families of the fallen Dallas Police Officers.
Click here for full coverage on the deadly Dallas police officer shootings.
Obama pays tribute to Dallas officers shot in racial attack
DALLAS POLICE SHOOTING
More TOP STORIES News