Micah X. Johnson, the US Army reservist who served in Afghanistan, embraced militant black nationalism and professed a desire to "kill white people," was the lone shooter who killed five police officers and wounded seven more on Thursday.
"We believe Mr. Johnson, now deceased, was the lone shooter," Dallas mayor Mike Rawlings said at a press conference.
Johnson, 25, was killed by a bomb-carrying robot deployed against him in a parking garage where he had holed up, refusing to surrender after hours of negotiations with police.
Thursday night's bloodshed, which shattered an otherwise peaceful protest denouncing two fatal police shootings of black men in Louisiana and Minnesota this week, added a new layer of apprehension to emotional national debates over racial injustice and gun violence.
Two civilians were also wounded in the ambush in downtown Dallas. The five killed marked the highest death toll for US police in the line of duty from a single event since the Sept. 11, 2001, attacks.
Thursday's attack reverberated across the country, prompting both major political parties' presumptive presidential nominees — Democrat Hillary Clinton and Republican Donald Trump — to cancel campaign events on Friday.
Police in Cleveland said they were tightening security plans for next week's Republican National Convention, which caps a political season marked by incendiary rhetoric and occasional violence at campaign rallies.
Other police departments across the country, including New York, Chicago and St. Louis, responded to the attack by requiring officers to patrol in pairs rather than alone.
Thousands of protesters took to the streets in several US cities on Friday for a second day of protests over the killings of Philando Castile, 32, near St. Paul, Minnesota, on Wednesday, and Alton Sterling, 37, in Baton Rouge, Louisiana, on Tuesday.
Dallas police chief David Brown disclosed that the gunman cited his anger over the two killings during his protracted negotiations with police.
"The suspect said he was upset at white people. The suspect stated that he wanted to kill white people, especially white officers," said Brown, who is African-American.
It was at the end of a rally in Dallas that gunshots crackled on Thursday night, sending hundreds of demonstrators, and police officers patrolling the march, scurrying for cover. Police initially believed they had come under attack from multiple shooters.
By late Friday, however, investigators had concluded that Johnson, armed with a rifle, was the lone gunman.
US Homeland Security Secretary Jeh Johnson told reporters there appeared to be "no known links to, or inspiration from, any international terrorist organization." Still, officials said they were looking for evidence of any possible co-conspirators.
A search of the gunman's home just outside Dallas found bomb-making materials, ballistic vests, rifles, ammunition and a personal journal of combat tactics, though he had no previous criminal history, police said.
But police said social media entries showed he subscribed to a militant black nationalist ideology, including an anti-white diatribe posted last week on a Facebook page of a group called the Black Panther Party Mississippi.
The US Army said Johnson had served as a private first class in the Army Reserve and was deployed to Afghanistan from November 2013 to July 2014. It said Johnson served from March 2009 to April 2015, and was a carpentry and masonry specialist with the 420th Engineering Brigade based in Texas.
President Barack Obama called the Dallas shootings "a vicious, calculated and despicable attack on law enforcement." He planned to visit Dallas early next week, at the mayor's invitation, the White House said.