President Obama on Sunday urged Americans on all sides of the Black Lives Matter debate to "listen to each other" and not undercut the cause of reform through violence or careless talk.
"Whenever those of us who are concerned about failures of the criminal justice system attack police, you are doing a disservice to the cause," Obama said during a brief news conference after meeting with Spain's prime minister here.
"First of all, any violence directed at police officers is a reprehensible crime and needs to be prosecuted," Obama said. Beyond that, even rhetorically painting police with a broad brush or saying "things that are stupid or imprudent" risks harming the reform cause, he said.
The majority of protesters "who are doing the right thing, peacefully protesting" should not be held "responsible for everything that is uttered at a protest site," he added.
Any protest movement will have "folks who say things that are stupid or imprudent or over generalized or harsh," Obama said. By contrast, he said, a thoughtful and respectful tone will help bring about real change.
He added that he thinks many law enforcement agencies, including the Dallas Police Department, are already taking seriously the problem of racial bias in criminal justice.
Obama's meeting with the interim prime minister was part of an abbreviated visit here. It was cut short by his decision to return to the U.S. early in the wake of a tumultuous week during which two black men were shot and killed by police officers in Louisiana and Minnesota and five police officers were killed by a sniper while guarding a peaceful protest in Dallas.
On Sunday morning, Obama tried to comfort and calm from a distance. He called on police organizations to be respectful of the frustrations that black communities feel and said he hopes people don't dismiss Black Lives Matter concerns as political correctness.
"I'd like all sides to listen to each other," he said.
As it was, President Obama's planned two-day visit to Spain after attending a NATO summit in Poland had an eighth year, box-ticking aspect to it.
Spain was the largest European country that the president had yet to visit as president, one through which, he noted here, he had backpacked before law school but not returned to since.
In the wake of this week's shooting rampage targeting police officers in Dallas, which occurred barely hours after the president had first touched down in Poland, the add-on stop presented a challenge for a White House that has long made a point of saying it put a priority on substantive considerations over symbolism.
Given the acceleration of protests over police-involved shootings — which continued another day in the U.S. — and the shocking nature of the rampage targeting law enforcement, the president ultimately struck a middle ground.
"I wish I could stay longer," Obama said as he stood alongside King Felipe VI at a formal welcome ceremony at the Palacio Real that had been moved up a day.
"We've had a difficult week in the United States."
Paying even a brief, one-day visit was important, Obama added, given the strong ties between the U.S. and Spain, a key NATO partner struggling with its own internal political turmoil.
"It is incredibly important for us to have such a strong partnership with the Spanish government and the Spanish people," he said.
Obama was to have spent Sunday on a sightseeing tour through Seville, visiting sights such as the Alcazar and the Santa Maria de la Sede cathedral with the king.
Instead, he traveled directly to the Spanish capital for formal meetings with the head of state as well as the country's interim prime minister, who is struggling to form a government after a second inconclusive election.
The president will continue with plans to visit a naval station in Rota where he will tour the guided missile destroyer Ross, which is stationed there, and later address American troops. That long planned stop was an especially important commitment to keep for the commander in chief, officials said.
The U.S. naval presence there is a strategic one, part of the Aegis missile defense program and with a force capable of deploying to nearby regional hot spots, including Northern Africa.
Obama will return to Washington late Sunday night, ahead of a visit to Dallas planned for Tuesday to mourn the five killed and others injured in the Thursday night attack.
As he prepared for a hasty departure, Obama said he would definitely come back to Spain after he leaves office. The food and climate are "hard to resist," he said, even for teenagers.
"As your children get older, they don't always want to spend time with you, but if you tell them, 'We'll take you to Spain,' then that's a good way to bribe them," he said.
For more White House coverage, follow @mikememoli on Twitter.
10:30 a.m.: This article was updated with the announcement that President Obama will travel to Dallas on Tuesday for a memorial.
8:48 a.m.: This article was updated with additional remarks by President Obama.