President Obama, attending another service for victims of a mass shooting and trying to mend a country riven by distrust between citizens and police, paid tribute to five Dallas officers ambushed at a protest last week, saying their deaths should remind Americans of their common ideals.
He spoke of the thankless work done by police officers around the country, and of the legitimate grievances that many black people feel from years of discrimination, including at the hands of law enforcement.
And he also gave the country a pep talk, urging citizens not to lose hope in a squall of violence that began with black men killed by police officers in Louisiana and Minnesota and culminated with the officers' killings on Thursday.
"We see all this and it's hard not to think the center won't hold and things won't get worse," he said. "I understand. But Dallas, I'm here to say we must reject such despair. I'm here to insist we're not as divided as we seem. I know that because I know America. I know how far we've come despite impossible odds."
The president told brief personal stories about each of the five officers with the Dallas Police Department and the Dallas Area Rapid Transit police force: Lorne Ahrens, Michael Krol, Michael J. Smith, Brent Thompson and Patrick Zamarripa. Calling them heroes, he described their relationships with their wives and children and extended families, their dedication to public service, and the routine ways they spent their final days.
He told how they died at the hands of a vengeful gunman while protecting people marching against police brutality.
"Like police officers across the country, these men and their families shared a commitment to something more than themselves," Obama said.
He added: "They were upholding the Constitutional rights of this country."
Tuesday's service marked the start of a deep period of mourning in Dallas, with funerals for the dead officers to begin the following day. For Obama, it marked the 11th time during his presidency that he'd visited scenes of mass shootings to offer condolences, most recently last month in Orlando.
The president admitted that he has felt overwhelmed by near-constant cycles of violence, grief and anger. But he urged the country not to become hardened.
"These five heroes knew more than most that we cannot take the blessings of this country for granted," Obama said. "The pain we feel will not soon pass, but my faith tells me they have not died in vain."
Obama, who met with the families after the service, had several audiences in mind on Tuesday. He addressed those mourning the officers, but also those mourning the two men, Philando Castile and Alton Sterling, who were killed by police earlier last week. He spoke to people protesting those prior deaths, and to people who argued that those protesters were inciting the kind of violence that erupted in Dallas.
Invoking scripture and the nation's long civil rights struggle, Obama urged all of them to remember their shared goals of justice and peace.
He quoted from the Gospel of John: "Let us not love with words or speech but with actions and in truth."
"If we're to sustain the unity we need to get through these difficult times, if we are to honor these five outstanding officers whom we've lost, then we will need to act on the truths that we know," Obama said. "And that's not easy. It makes us uncomfortable. But we're going to have to be honest with each other and ourselves. We know that the overwhelming majority of police officers do an incredibly hard and dangerous jobs honorably and fairly, and they are deserving of our respect and not our scorn."
The crowd applauded.
The president continued: "And when anyone, no matter how good their intentions may be, paints all police as biased or bigoted, they undermine those officers we depend on for our safety."
The Morton H. Meyerson Symphony Center was packed with officers, some of whom sat on stage near photos of each of the slain officers. In the front row sat the officers' family members, next to five empty chairs, adorned with their service hats and American flags folded into triangles.
Also in attendance were Vice President Joseph Biden and mayors and governors from around the country.
Obama's predecessor, George W. Bush, a former Texas governor, called for Americans to remember their shared values rather than the things that pulled them apart.
"This is the bridge across the nation's deepest divisions," Bush said. "We don't want the unity of grief, nor do we want the unity of fear. We want the unity of hope, affection and high purpose."
Bush was followed by Dallas Police Chief David Brown, who received a standing ovation after Mayor Michael Rawlings called him "my rock."
Brown took a unorthodox but emotional tack, reading the lyrics to Stevie Wonder's "As," which he dedicated to the families of the five slain officers:
"We all know sometimes life's hates and troubles
Can make you wish you were born in another time and space
But you can bet you life times that and twice its double
That God knew exactly where he wanted you to be placed."
Rawlings said the pain was particularly sharp because the dead officers were targeted as they protected a peaceful rally against police shootings, and because Dallas had earned a reputation for mending decades old wounds between police and the local black community.
"I have searched hard in my soul of late for what mistakes we have made. I've asked, 'why us,' and in my moments of self doubt I found the truth: that we did nothing wrong," Rawlings said. "In fact, Dallas is very, very good. Our police are among the best in the country. I'm in awe of our police officers."