"I believe our sorrow can make us a better country. I believe our righteous anger can be transformed into more justice and more peace. Weeping may endure for a night but I'm convinced joy comes in the morning," the President said.
The Dallas officers were fatally gunned down Thursday by a sniper, an armed-to-the-teeth Army veteran who targeted the officers, perhaps as retribution for police violence largely unrelated to North Texas.
For five days, the news has revolved around the horrific details of the slayings, but on Tuesday afternoon the focus was on the men in blue who lost their lives keeping watch over what had been a peaceful protest.
Brent Thompson, 43, a newlywed.
Lorne Ahrens, 48, whose smile was regularly reciprocated.
Patrick Zamarripa, 32, a father.
Michael Krol, 40, whose lifelong dream was to become a police officer.
Michael Smith, 55, an Army Ranger and family man.
Five chairs at the memorial were left open in tribute, a folded United States flag on each one.
Their deaths came amid a tragic week for the nation
that saw Alton Sterling in Louisiana and Philando Castile in Minnesota killed during encounters with police.
Obama praised police for protecting and serving the people.
"Like police officers across the country, these men and their families shared a commitment to something larger than themselves," the President said. "... The reward comes in knowing that our entire way of life in America depends on the rule of law, that the maintenance of that law is a hard and daily labor, that in this country, we don't have soldiers in the streets or militias setting the rules. Instead, we have public servants, police officers, like the men who were taken away from us."
Police in Dallas "showed incredible restraint" and "saved more lives than we will ever know," Obama said.
"When the bullets started flying, the men and women of the Dallas police, they did not flinch, and they did not act recklessly," he said.
Former President George W. Bush called for unity.
"At times, it seems like the forces pulling us apart are stronger than the forces binding us together. Argument turns too easily into animosity. ... Too often we judge other groups by their worst examples, while judging ourselves by our best intentions," said Bush, who is also a former governor of Texas.
Bush said Americans need to remember the values of the country.
"We have never been held together by blood or background. We are bound by things of the spirit, by shared commitments to common ideals," he said.
Dallas Mayor Mike Rawlings and Police Chief David Brown also addressed the crowd.
Brown drew chuckles when he talked about his trouble in the past in finding the right words for big moments, mainly talking to pretty girls.
For people he loved, he said, he reached for the lyrics of one of the biggest music stars of his generation.
So on Tuesday he used the words of Stevie Wonder's song "As" to speak to the families of the officers who were killed.
One of the verses goes: "We all know sometimes life's hate and troubles can make you wish you were born in another time and place. But you can bet your life times that, and twice its double, that God knew exactly where he wanted you to be placed. So make sure when you say you're not in it, but not of it, you're not helping to make this Earth a place sometimes called Hell. Change your words into truth and then change that truth into love. And maybe your children's grandchildren and their great-great-grandchildren will tell them, 'I'll be loving you.' "
The mayor called for the city to come together as it grieves. He said there would be tough times in the future but this was a chance for Dallas to lead the country in showing what a model city should be. The key was to do things as one city
"We will mourn together, and together is the key word here. We may be sad, but we will not dwell in self-pity. We may weep, but we will never whine. For we have too much work to be done. We have too many bridges to build that we will cross together," Rawlings said.
The ceremony was not public, but the memorial was being simulcast at Klyde Warren Park, a short walk from the symphony hall.
In addition to their rare joint appearance, Obama and Bush also were to meet
after the service with the families of the slain officers.
An interfaith choir opened Tuesday afternoon's service, and the Dallas Police Choir sang the national anthem. An imam, rabbi and Methodist minister from the area delivered prayers before the speakers took the podium.
The ceremony ended with the interfaith choir -- composed of singers from area congregations -- joining the Dallas Police Choir in "The Battle Hymn of the Republic" as the officials on stage clasped each others' hands.