Gun-rights activists, some of them openly toting rifles and handguns, marched alongside the hundreds of people who flocked to downtown Dallas last week to protest police shootings of blacks.
The President will visit the Texas city at the request of Dallas Mayor Mike Rawlings, White House Press Secretary Josh Earnest said in a statement Sunday afternoon. George W. Bush and his wife, Laura, will also attend, and the ex-president will deliver brief remarks.
Obama's remarks also captured the president continuing to try to serve as bridge builder between white and black Americans, protesters and police. The President will also meet privately with the families of the fallen police officers and those who were injured to personally express the nation's support and gratitude for their service and sacrifice.
The service will take place at the Morton H. Meyerson Symphony Center.
He said Johnson had material for explosives in his home and talked of using IEDs (improvised explosive devices) during a police stand-off that followed the shootings.
The Dallas police chief says the suspect in the deadly attack on officers taunted authorities during two hours of negotiations, laughing at them and at one point asking how many officers he had shot.
Demonstrations have been held nationwide following the deaths of 32-year-old Philando Castile in St Paul and 37-year-old Alton Sterling in Baton Rouge.
The protests are continuing across the USA, and there have been hundreds of arrests, and reports of violence at some of the demonstrations. Chip Reid reports on the president's response to the attack. Vice President Joe Biden will also be there.
Obama said that the United States and Spain share basic values and are "working together" at Rota because they want the people of the world to be able to live with security and dignity.
For President Barack Obama, the decision to return early from an overseas trip after a series of shocking shootings will prove to be easy compared to his next challenge: Comforting an America rattled by the violence. Obama is squeezing in a visit to a key North Atlantic Treaty Organisation and European Union partner before dashing home to deal with the aftermath of a wrenching shooting in Dallas.
King Felipe also gave the president a gift for visiting: Per the Royal Palace, the King gave him an English edition of Don Quixote, edited by Penguin and translated by John Rutherford, with leather covers stamped with a US seal and the Royal House seal.