The US Army veteran who was killed by a bomb-laden robot in Dallas appears to have been the lone gunman whose sniper attack left five cops dead and seven others wounded, according to a report.

Micah Xavier Johnson, 25, of Mesquite, who served a tour of duty in Afghanistan, was killed Friday morning when police detonated a bomb after negotiations broke down with him.

“He was upset about Black Lives Matter, the recent police shootings, he was upset at white people. He wanted to kill white people, especially police officers,” Dallas Police Chief David Brown said.

Three other people are in custody but it appears that Johnson was the sole gunman whose attack also left two civilians wounded, a senior law enforcement official told The New York Times.

Authorities initially said that at least two snipers had carried out an ambush by firing from various positions, including from elevated ones downtown.

Johnson, who identified himself on Facebook as a black nationalist, had no known criminal history or links to terror groups, officials said.

He is seen on Facebook wearing a dashiki, a traditional West African shirt, as he raises his clenched right first.

Johnson liked pages connected to Elijah Mohammed, the deceased founder of the Nation of Islam, and other militant groups such as The New Black Panther Party and the African American Defense League.

“Our hostage negotiating team did an exceptional job getting this suspect to talk,” the city’s top cop said about the man, who had been holed up for hours in an El Centro College garage.

Brown said cops had no choice but to use the bomb: “Other options would have exposed our officers to grave danger.”

The new information emerged after snipers gunned down five police officers and injured seven others during protests over two fatal police shootings of black men — an explosion of violence described as the deadliest day for law enforcement since 9/11.

Two civilians also were wounded, including Shetamia Taylor, 37, who was shot in the calf and was undergoing surgery Friday morning, said Mayor Mike Rawlings.

Four of the slain cops were members of the Dallas Police Department and one was a Dallas Area Rapid Transit cop, 43-year-old Brent Thompson, officials said.

One of the slain members of the Dallas police force was identified as Patrick Zamarripa, a young father who described himself on Twitter as “addicted to the thrill of this job.”

Another was identified as Michael Krol, who joined the Dallas force in 2007 after spending four years working for the jail system of the Wayne County Sheriff’s Office in Michigan, Fox 2 Detroit reported.

“We are saddened by the loss of the dedicated officers in Dallas– one of whom was a former member of this agency — and also the wounding of the other officers,” Sheriff Beny Napoleon said in a statement.

The wounded DART officers were identified as Omar Cannon, 44, Misty McBride, 32, and Jesus Retana, 39.

Most of the injured cops have been released from a hospital, Brown told reporters. Their conditions are improving, he said.

In other developments:

Chuck Canterbury, national president of the Fraternal Order of Police, called on the US Justice Department to immediately investigate the Dallas killings as a hate crime.

“The FOP has spent two years calling on this Congress and this Administration to expand Federal law to protect law enforcement officers,” Canterbury said in a statement. “How many more assassinations, how many more ambushes, how many more dead officers must we endure before action is taken?”

President Obama condemned the attack as a “vicious, calculated and despicable attack on law enforcement.”

He pledged that “anyone involved in the senseless murders will be held fully accountable. Justice will be done.”

The presidential campaign has been put on hold as Donald Trump and Hillary Clinton postponed their campaigns because of the Dallas massacre.

“Last night’s horrific execution-style shootings of 12 Dallas law enforcement officers … is an attack on our country. It is a coordinated, premeditated assault on the men and women who keep us safe,” Trump said in a statement.

On Twitter, Clinton said: “I mourn for the officers shot while doing their sacred duty to protect peaceful protesters, for their families & all who serve with them.”

Leaders of the Black Lives Matter movement are condemning the shootings.

Shaun King, a blogger who rose to prominence after the 2014 fatal police shooting of Michael Brown in Ferguson, Missouri, said on Twitter that he hates police brutality but doesn’t hate police.

“This violence is wrong on every level,” he said.

Meanwhile, the family of Alton Sterling — who was shot Tuesday after being pinned to the pavement by two white cops in Baton Rouge, Louisiana — denounced the shootings of Dallas police.

“We wholeheartedly reject the reprehensible acts of violence that were perpetrated against members of the Dallas Police Department,” Quinyetta McMillon, the mother of the slain man’s son, Cameron, said in a statement.

On Wednesday, a police officer in Minnesota fatally shot Philando Castile as he sat in a car with his girlfriend, Diamond Reynolds, and her 4-year-old daughter. Reynolds livestreamed the bloody aftermath of the shooting on Facebook, sparking further outrage over police shootings.

On Friday, Reynolds said: “This thing that has happened in Dallas, it was not because of something that transpired in Minnesota. This is bigger than Philando … this is bigger than all of us,” she said.