US President Barack Obama has decided to cut short his first trip to Spain in the wake of the shootings of black men by police in Louisiana and Minnesota and the killing of five police officers by a sniper in Dallas.
Instead of spending two days sightseeing in southern Spain and tending to more pressing business in the capital of Madrid, the White House has scrapped some of Mr Obama's events - including a staple of his foreign travels, a question-and-answer forum with young people - and crammed the rest of his schedule into Sunday.
He will then return to the White House late on Sunday, a day earlier than originally planned.
"This has been a tough week," Mr Obama said on Saturday as he addressed the violence for the third time in as many days while in Poland, where he attended a Nato summit on the first stop of a two-country European trip. He rejected any notion that what happened marked a return to the racial brutality of a dark past in the US.
As painful as the killings were, he said: "America is not as divided as some have suggested."
Mr Obama received a red-carpet, airport welcome after he arrived in Spain late on Saturday to open the last leg of what is likely his final trip to Europe before leaving office in January.
In a visit designed to highlight security cooperation, he planned separate meetings on Sunday with King Felipe and acting Prime Minister Mariano Rajoy.
He was set to tour the USS Ross, one of four guided-missile destroyers based at Naval Station Rota, a US-subsidised, Spanish-owned port in the south, and address troops stationed there before the flight home.
Mr Obama said he had longed to return to Spain ever since he passed through while backpacking across Europe during his 20s, but that the "horrific shootings in the United States require that I cut my time here short".
Mr Obama acknowledged the "difficult week" when he met King Felipe at Spain's Royal Palace.
The king thanked Mr Obama for visiting under the circumstances.