President Barack Obama delivers remarks during an interfaith memorial service, honoring five slain police officers, at the Morton H. Meyerson Symphony Center on July 12, 2016 in Dallas, Texas. A sniper opend fire following a Black Lives Matter march in Dallas killing five police officers and injuring 12 others. (Photo by Tom Pennington/Getty Images)

President Barack Obama delivers remarks during an interfaith memorial service, honoring five slain police officers, at the Morton H. Meyerson Symphony Center on July 12, 2016 in Dallas, Texas. A sniper opened fire following a Black Lives Matter march in Dallas killing five police officers and injuring 12 others. (Photo by Tom Pennington/Getty Images)

President Barack Obama threaded the needle between honoring police officers and affirming the concerns about law enforcement conduct in his remarks at the memorial service for the five members of the Dallas Police Department killed by a sniper last Thursday.

“From the moment you put on that uniform, you have answered a call that at any moment, even in the briefest interaction, may put your life in harm’s way,” Obama said, detailing how the five fallen officers came to be members of the force. “Like police officers around the country, these men and their families shared a commitment to something larger than themselves.”

Five chairs stood empty, each with a police officer’s hat and folded American flag, in memory of the officers, who were shot during a protest of fatal police shootings of civilians across the country. He called the shooting “an act not just of demented violence but of racial hatred.”

“Despite the fact that police conduct was the subject of the protest, despite the fact that there must have been signs and slogans or chants with which they profoundly disagreed, these men and this department did their jobs like the professionals they were,” Obama said.

The president acknowledged that the country was struggling, following the deaths of Alton Sterling and Philando Castile at police hands earlier last week.

Obama rejected the idea that all police officers were bigoted but noted that studies show that whites and people of color experience the criminal justice system differently. “We cannot simply turn away dismiss those in peaceful protest as troublemakers or paranoid.”

“Race relations have improved in my lifetime,” said Obama. “But America, we know bias remains. We know it. No institution is immune—and that includes our police departments.”

He said that, despite how it may feel, the racial divide in America was not too great to bridge, though change would require talking honestly about making changes, even when it’s uncomfortable.

“We ask the police to do too much, and we ask too little of ourselves” he said. “As a society we choose to under-invest in decent schools. We allow poverty to fester so that entire neighborhoods offer no prospect for gainful employment. We refuse to fund drug treatment and mental health programs. We flood communities with so many guns that it is easier for a teenager to buy a Glock than get his hands on a computer, or even a book.”

Joining the president were former President George W. and Laura Bush, Vice President Joe Biden and Dr. Jill Biden, Dallas Mayor Mike Rawlings, Police Chief David Brown, and many officers.

Obama ended the speech by calling for citizens to have an open heart. “With an open heart, those protesting for change will guard against reckless language going forward,” he said. “But even those who dislike the phrase ‘Black Lives Matter,’ surely we should be able to hear the pain of Alton Sterling’s family.”