Washington:US President Barack Obama would cut short his trip to the Europe by a day and visit Dallas early next week, the White House said on Friday. Obama would travel to Spain on Saturday as scheduled but would return to Washington on Sunday and visit Dallas where 12 police officers were shot in an ambush on Thursday that left five of them dead, NBCnews reported. Obama was invited to visit Dallas by the city's Mayor Mike Rawlings. The deadly shooting in Dallas was the largest loss of police lives since the September 11 attacks. Police believed the gunman who was killed by a bomb delivered by a police robot during a standoff, was the only shooter involved in the attack. The sniper attack took place near the end of a demonstration and march in Dallas protesting the recent police shootings of black men in Louisiana and Minnesota. The gunman, identified as Micah Johnson, 25, told police negotiators that he was upset by the recent police shootings and "wanted to kill white people, especially white police officials", NBCnews quoted Dallas' Police Chief David Brown as saying. Obama ordered flags flown at half-staff until Tuesday as a mark of respect to the victims. Later in the week, Obama "will continue the work to bring people together to support our police officers and communities, and find common ground by discussing policy ideas for addressing the persistent racial disparities in our criminal justice system", the White House said.