An Army veteran killed by Dallas police after he fatally shot five officers amassed a personal arsenal at his home - including bomb-making materials, bulletproof vests, rifles, ammunition and a journal of combat tactics.
The man identified as 25-year-old Micah Johnson told authorities he was upset about the fatal police shootings of two black men earlier this week and wanted to exterminate whites, "especially white officers", officials said.
He was killed by a robot-delivered bomb after the shootings, which marked the deadliest day for US law enforcement since the September 11, 2001, terrorist attacks. In all, 12 officers were shot.
In Georgia, Missouri and Tennessee, authorities said gun-wielding civilians also shot officers in individual attacks that came after the black men were killed in Louisiana and Minnesota. Two officers were wounded, one critically.
President Barack Obama will cut short his European trip and visit Dallas early next week.
He had been scheduled to return to Washington on Monday. Instead, he will leave Spain on Sunday night after meeting the interim prime minister and visiting US military personnel.
Obama is currently in Warsaw, Poland, for a Nato summit.
The White House said the president will focus next week on efforts to support police officers while addressing "persistent racial disparities" in the criminal justice system.
Johnson was a private first class from the Dallas suburb of Mesquite who specialised in carpentry and masonry.
He served in the Army Reserve for six years starting in 2009 and did one tour in Afghanistan from November 2013 to July 2014, the military said.
After the attack, he tried to take refuge in a parking garage and exchanged gunfire with police, Police Chief David Brown said.
The suspect described his motive during negotiations and said he acted alone and was not affiliated with any groups, Mr Brown said.
Johnson was black. Law enforcement officials did not disclose the race of the dead officers.
The bloodshed occurred close to where president John F Kennedy was killed in 1963.
The shooting began on Thursday evening while hundreds of people were gathered to protest against the killings in Baton Rouge, Louisiana, and suburban St Paul, Minnesota.
Brown told reporters that snipers fired "ambush-style" on the officers. Two civilians were also wounded. The authorities initially blamed multiple "snipers" for Thursday's attack, and at one point said three suspects were in custody.
But later, all attention focused on Johnson, and state and federal officials said the entire attack appeared to be the work of a single gunman.
With the lone shooter dead, Mayor Mike Rawlings declared that the city was safe and "we can move on to healing".
He said the gunman wore a protective vest and used an AR-15 rifle, a weapon similar to the one fired last month in the attack on an Orlando nightclub that killed 49 people.