They stood in a line, clasping hands as a choir sang, Democrat and Republican, black and white, politician and cop.
Led by US President Barack Obama and his predecessor George W. Bush, they honoured the five Dallas policemen slain last week and urged Americans to rise above racial divides and reject despair.
The memorial service took place after a week when Americans were jarred by video images of angry crowds protesting police killings of black men in Louisiana and Minnesota, and heard the screams of Thursday's sniper attack on police in Dallas by a black veteran who had said he wanted to "kill white people".
"We turn on the TV or surf the internet, and we can watch positions harden and lines drawn and people retreat to their respective corners," the first black US President said.
"I understand how Americans are feeling. But 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."
In a spontaneous display of unity, Obama and first lady Michelle Obama, former president George W. Bush and his wife Laura, Vice President Joe Biden and his wife Jill, Mayor Mike Rawlings, Police Chief David Brown and others on stage joined hands at the end of the service as a choir sang The Battle Hymn of the Republic.
Obama sought a careful balance, paying tribute to the dead police officers and showing respect for the country's law enforcement while also acknowledging the concerns of those protesting against police violence.
He noted that the Dallas attack came during a protest against racial discrimination in policing that followed the fatal police shootings of black men in Baton Rouge, Louisiana, and outside St Paul, Minnesota.
A series of high-profile police killings of black men in the past two years have sparked the most intense debate on race and justice in America in decades.
"America, we know that bias remains. We know it," Obama told the crowd of several hundred people, including many uniformed police officers, at the Morton H. Meyerson Symphony Center.
"None of us is entirely innocent. No institution is entirely immune. And this includes our police departments."
Obama alluded to the Black Lives Matter protest movement stirred into action by the long series of police killings, which some have painted as anti-police.
He said that even people who dislike the phrase Black Lives Matter should recognise the pain felt by the family of Alton Sterling, the 37-year-old black man shot dead last week in Baton Rouge by police who said he was reaching for a gun.
Obama praised the police in Dallas and around the country.
"When anyone, no matter how good their intentions may be, paints all police as biased or bigoted, we undermine those officers we depend on for our safety," Obama said.
"And as for those who use rhetoric suggesting harm to police, even if they don't act on it themselves, well they not only make the jobs of police officers even more dangerous, but they do a disservice to the very cause of justice that they claim to promote," Obama added.
Bush also addressed the packed hall, where five chairs were empty of people, holding folded American flags, in memory of the slain officers. Bush too sought to strike a note of unity.
"At times it feels like the forces pulling us apart are stronger than the forces binding us together. Argument turns too easily into animosity," Bush said.
"We do not want the unity of grief nor do we want the unity of fear. We want the unity of hope, affection and high purpose."
During his flight to Dallas, Obama placed condolence calls to families of Sterling and of Philando Castile, the 32-year-old man shot dead during a traffic stop outside St. Paul.