U.S. President Barack Obama is calling on Americans to mutually respect fellow citizens days after two fatal police shootings of African Americans and an ambush that killed five policemen in Dallas, Texas.
"Maintaining a truthful and serious and respectful tone is going to help mobilize American society to bring about real change and that is our ultimate objective," Obama said in a response to a question from a reporter as he met Sunday in Madrid, Spain, with Prime Minister Mariano Rajoy.
"I would like all sides to listen to each other," Obama said in reference to protestors such as those involved with the 'Black Lives Matter' movement and police organizations throughout the U.S.
Obama said violence against police by anyone concerned about fairness in the criminal justice system does "a disservice to the cause."
The president also called for balance from law enforcement. "It is in the interest of police officers that their communities trust them."
In Pictures: A Nation Protesting and Mourning
The president was on an abbreviated first presidential trip to Spain, a day after attending the NATO summit in Warsaw, Poland, where he devoted much of his news conference to events back home.
"I firmly believe America is not as divided as some have suggested," Obama said. He said the country has a foundation to build on to tackle the very real problems it faces, including tensions between law enforcement and minority communities.
Obama is cutting his trip to Europe short by one day and will return Sunday to Washington in order to travel to Dallas in the coming days at the invitation of Mayor Mike Rawlings.
WATCH: Dallas Honors Fallen Officers
The city remains on edge, especially after Dallas police received an anonymous threat against officers across the city Saturday. The threat led officials to lock down the headquarters and several blocks surrounding the building as a "precautionary measure," a police statement said.
When asked in Poland about how he would characterize Dallas shooter Micah Johnson, Obama called him a "demented individual."
The Dallas shooter is not representative of blacks, the president said, just as the man who killed people at a historic African-American church last year in Charleston is not representative of whites, and the Muslim-American who killed 49 people at an Orlando nightclub last month is not representative of Muslim-Americans.
'Part of the problem'
On the issue of gun violence, in response to a question, Obama said, "I am not going to stop talking about guns, because they are part of the problem."
He said if people care about the safety of police officers, they cannot pretend that the gun issue is irrelevant. He said it would never be possible to stop every violent madman intent on carnage, but the U.S. could make it much harder for them.
He said the scope of gun violence in the United States is unique.
Obama spoke at length in Poland on race relations, rejecting any suggestion that the country is returning to the strife and urban riots of the 1960s, and that police in Dallas kept on protecting protesters even while they were being shot at.
He said the country has made tremendous progress, both in lowering violent crime rates and on racial equality. But, the president added, the legacy of racism endures, and there is much work still to be done.
Obama said he hopes his two daughters, Sasha and Malia, and their children can live in a more just and equal country, but that progress takes time.
Asked about his legacy on race as the first African-American president, Obama said: "We plant seeds. And somebody else maybe sits under the shade of the tree that we planted."
Details of attack
Dallas Mayor Rawlings confirmed the shooting of five police officers on Thursday was carried out by a lone gunman, identified as Micah Johnson. The attack, which city officials labeled an "ambush," happened toward the end of a peaceful demonstration against the killing of two black men by police officers in Minnesota and Louisiana earlier in the week.
During a search of Johnson's home Friday, Dallas police detectives found bomb-making materials, ballistic vests, rifles, ammunition and a personal journal of combat tactics, the police department said. The gunman was a former Army reservist who served in Afghanistan.
The attack was the deadliest day for U.S. law enforcement since the terror attacks of September 11, 2001.