DALLAS — The targeted killing of five police officers at a protest in Dallas late Thursday was the work of a lone gunman, authorities said Friday, a brutal and methodical act of racial hatred intended as revenge for perceived racial disparity. Before he was killed by a robot-delivered bomb, he told negotiators he had been motivated by police killings of black men.

He wanted to kill white people, he said, especially white officers.

With those words and the hurricane of bullets that came before them, the gunman ripped open already volatile fissures in the nation. At Micah Xavier Johnson’s home in a Dallas suburb, authorities found the well-known tools of a mass murderer: bomb making and ballistic materials, more guns and ammunition.

The chilling nature and deadly scale of the attack sent shock waves through the country, on the third day of violence that Americans have watched this week in graphic videos, first from Baton Rouge, Louisiana, then from a suburb of St. Paul, Minnesota.

On Friday evening, another governor, the third of the week, appeared before the microphones and called for unity.

Fear of contagion rippled through law enforcement nationwide as police chiefs from Washington to Los Angeles ordered patrol officers to go out in pairs for safety. Officers were shot Friday in Missouri and Georgia; one was in critical condition.

The attack, at the end of a peaceful Black Lives Matter march, altered almost instantly the boiling debate over excessive force and racial targeting by police, as protesters distanced themselves from the gunman’s actions while taking to the streets again in their campaign against violence. Demonstrators marched in several cities, including Atlanta, Baltimore and Baton Rouge, where photos showed police in riot gear.

And the ambush sharpened an already rancorous political debate, even as the two candidates in the presidential race canceled events.

Warning: The following video contains graphic images.

On Friday, the Texas city of 1.3 million was left raw and hurting. Police huddled together, seeking comfort in circles. Entire swaths of Dallas’s gleaming downtown remained a crime scene, with streets blocked by officers and the constant drone of helicopters overhead.

“Texans have always shown trademark resilience, which is needed now more than ever,” said Gov. Greg Abbott.

The bloodshed in Dallas marked the deadliest single day for the nation’s police since the Sept. 11, 2001, terrorist attacks, with five officers killed and seven others injured.

A week that began with the celebration of American independence quickly turned tragic Tuesday morning with video from Baton Rouge, where Alton Sterling was fatally shot by police as he lay on the ground.

Less than 48 hours later, another police shooting and another graphic video – this time live streamed on Facebook by the victim’s girlfriend. As blood spreads on the victim’s shirt, his girlfriend explains in the video that Philando Castile was just reaching for his ID when the officer opened fire.

The two shootings sparked fresh scrutiny of police and how they use deadly force and renewed protests across the country, including the fateful one in Dallas.

MAYOR SAYS GUNMAN USED AR-15

The gunfire began around 9 p.m. Thursday. Even as people scrambled for cover, some posted videos to social media showing the killings in real time. One video showed a person with an assault-style rifle shooting a police officer in the back at point-blank range. Dallas Mayor Mike Rawlings said the gun was an AR-15.

The gunman at one point fled to a college building downtown. For hours after the initial assault, police were locked in a standoff with the shooter, exchanging gunfire and negotiating with him. When those talks broke down, Police Chief David Brown said, authorities saw no other option but to send a robot to detonate a bomb near the shooter, killing him.

Police identified the attacker as Johnson, a 25-year-old black man from the suburb of Mesquite. A reported “loner,” he did not appear to have ties to international terrorism, said a senior U.S. law enforcement official familiar with the investigation.

An Army veteran, he killed fellow veterans: Four of the five slain officers had served in the military.

Brent Thompson, 43, was a transit police officer and a newlywed. Patrick Zamarripa, 32, had served three tours in Iraq. Michael Krol, 40, had joined the Dallas police in 2008. Lorne Ahrens, a former semi-pro football player, had been with the department for 14 years. Michael Smith, a father of two, liked to give department stickers to the children at his church.

Seven other officers were injured. Their conditions were unknown.

‘THE END IS COMING’

Johnson’s profile picture on his Facebook page, confirmed by a federal law enforcement official, shows him raising a fist in the air, a gesture associated with the black power movement of the 1960s. He posted a similar image of a fist with the text “Black Power.”

He had no criminal record, police said. As an Army reservist, he had weapons training, worked in carpentry and masonry and deployed to Afghanistan once in 2013. He was a former member of an Army engineering company and served in the Individual Ready Reserve at the time of his death, meaning he didn’t have to attend regular training or drills but could be called into service, according to records.

During his negotiations with police Thursday night, Johnson said he was not involved with any groups and acted alone, authorities said. He spoke lucidly and told authorities at one point that “the end is coming” and talked of bombs being placed downtown, though no explosives were found.

“He did his damage, but we did our damage to him as well,” Rawlings said. “And we believe now that the city is safe and that the suspect is dead, and we can move on to healing.”

On Friday evening, signs of the previous night’s violence still littered the streets of downtown Dallas. At the center of it all was a 14-story red-brick parking garage, where much of the shooting took place.

Shattered glass was sprayed across the building’s plaza. “You’re in a crime scene, sir!” a police officer shouted at a reporter who ventured too close. One man passed out copies of the Ten Commandments to the law enforcement officers guarding the scene.

A woman held an “All Lives Matter” placard. But there was not much of an audience on the largely empty streets for anyone protesting.

Outside police headquarters, a steady stream of locals paid their respects, draping flowers and toys across police cars. Gathered in the shade, a band of officers watched quietly. Several had rushed from their homes the night before to try to help.

“I pulled on my uniform and came to protect my brothers,” said one officer, who spoke on the condition of anonymity. “I haven’t slept – I can’t. I knew every one of the guys who died.”

President Obama ordered flags flown at half-staff until Tuesday, and Attorney General Loretta Lynch vowed that the Justice Department would do anything it could to help with the investigation. Lynch also said she was “heartbroken” by the loss and urged peaceful protesters not to “be discouraged by those who use your lawful actions as cover for their heinous violence.”

Meanwhile, in Dallas – after the shooting, after police dealt with the gunman, after the chaos gave way to grief – the city’s mayor said he couldn’t shake a memory from those early hours. Rawlings remembered the moment he learned that a fifth officer had died.

“We were thinking, when is it going to stop? Five officers killed – this just doesn’t happen in the United States of America.”