Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Latest developments:

Police have identified the suspect as Micah Johnson, 25

Johnson was an Army reservist who deployed to Afghanistan, the Army said

Johnson is now believed to be the lone gunman, mayor says

The gunman in the ambush of 12 Dallas police officers "wanted to kill white people, especially white officers," and was upset about recent police shootings, the city police chief said Friday.

Dallas police on Friday identified the suspect, who they killed in the early hours of Friday morning, as Micah Johnson, 25.

Dallas Mayor Mike Rawlings said Friday evening that based on what investigators know, Johnson was the lone gunman in the ambush. In the immediate aftermath of the shooting, officials said they believed there were two snipers.

“We believe now that the city is safe, and the suspect is dead, and we can move on to healing,” Rawlings said Friday.

Rawlings said the gunman was “mobile” and was moving around multiple levels of a building and shooting from there. He said Johnson had written “manifestos on how to shoot and move, and he did that.”

“He did his damage, but we did damage to him as well,” Rawlings said.

Police searched Johnson's home and found bomb making materials, ballistic vests, rifles and ammunition and "a personal journal of combat tactics," police said in a statement Friday. Detectives are going through the journal, police said. He has no criminal history, police said.

Investigators have found no formal ties between Johnson and any kind of violent black power, black separatist or other domestic terror or militant group, a law enforcement source familiar with the investigation told NBC News.

Johnson used a SKS rifle as well as a handgun during his attack on police, multiple law enforcement sources said.

The officials stressed that the investigation remains fluid and said while Johnson may have been the lone gunman, the investigation into other possible suspects who may have assisted him continues.

“What we don’t know is who if anybody may have known what the gunman was going to do or may have assisted him in any of his efforts,” said Gov. Greg Abbott Friday.

Authorities killed the suspect after a standoff in a garage at El Centro Community College after several hours of negotiations. After exchanging gunfire with him, they "saw no other option" but to kill him by detonating a bomb, Dallas Police Chief David Brown said.

"Other options would have exposed our officers to grave danger," he said.

“This was a man that we gave plenty of options to give himself up peacefully,” Rawlings said. “We spent a lot of time talking. He had a choice to come out and we would not harm or stay in and we would. And he picked the latter.”

Officials told NBC News that Johnson was wearing body armor during the shooting.

Related: Suspect Was Army Veteran Who Did Afghanistan Stint

Johnson is a veteran who was in the Army Reserves from March 2009 to April 2015, the Army confirmed to NBC News. He served a tour of duty in Afghanistan from November 2013 to July 2014, and received several awards, including the Global War on Terrorism Service Medal.

Micah Xavier Johnson via Facebook

The sniper attack on the officers — which started Thursday night just before 9 p.m. local time following a peaceful protest over back-to-back police shootings of black men elsewhere in the country this week — killed five officers and injured seven.

Related: The Deadliest Attacks on U.S. Law Enforcement

It was the greatest loss of police lives since Sept. 11, 2001.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Three people were taken into custody prior to the suspect being killed.

Brown told reporters Friday morning the suspect who was killed "stated that he was not affiliated with any groups and he stated that he did this alone."

Related: Witnesses Recount Dallas Shooting Horror

"The suspect said other things that are part of this investigation so that we can make sure that everyone associated with this tragic event is brought to justice," he added, but didn't go into further detail.

Before he was killed, the suspect told a hostage negotiator that he "was upset about Black Lives Matter." The movement was again in the spotlight this week after two police shootings of black men: Alton Sterling in Baton Rouge, Louisiana, was killed Tuesday, and Philando Castile was killed Wednesday in Falcon Heights, Minnesota — prompting demonstrations across the nation, including Thursday's in Dallas.

The suspect told the hostage negotiator he was upset about the shootings.

"The suspect stated he wanted to kill white people, especially white officers," Brown said.

The shooting happened after the demonstration ended and as a march was taking place just several blocks from Dealey Plaza, where President John F. Kennedy was assassinated in 1963. About 800 people attended, and about 100 police officers were patrolling the event and surrounding area.

Rawlings praised the team who took down the suspect.

"The good news: He's gone off the face of the Earth," Rawlings told MSNBC.

Our thoughts, prayers, and support go out to all those affected by the tragic events last night in Dallas. pic.twitter.com/JzbFdFZIly — Dallas Cowboys (@dallascowboys) July 8, 2016

The casualties included eight Dallas police officers and four Dallas Area Rapid Transit (DART) officers, the mayor told NBC News on Friday morning.

Related: Dallas Police Ambush Victim Brent Thompson 'Served Admirably'

Four of the five slain officers were Dallas police, and the fifth was a DART officer. Two civilians were also wounded, authorities said.

The DART officer, Brent Thompson, 43, was the first person ever killed in the line of duty of in the 27-year history of the transit authority.

DART Chief James Spiller told MSNBC he had just gotten married within the last two weeks and was a "great officer."

He has served admirably during his time here at DART," Spiller said. "This is very heartbreaking for us."

Three injured DART officers were also identified: Misty McBride, 32, Omar Cannon, 44, and Jesus Retana, 39.

The Wayne County Sheriff's Office in Michigan identified one of the slain Dallas police officers as Michael Krol, a native of Redford Township, Michigan. Krol worked in the Wayne County Sheriff's Office jails from 2003 to 2007, the sheriff's office said.

“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 Benny Napoleon said in a statement.

Another slain officer, Patrick Zamarripa, was a six-year Dallas Police Department veteran and a married father to a 2-year-old daughter.

President Barack Obama, who was in Warsaw for a NATO meeting, said the U.S. was "horrified" by the "vicious, callous and despicable attack."

"I believe I speak for every single American when I say that we are horrified over these events and that we stand united with the people and the police department in Dallas," he said.

U.S. Attorney General Loretta Lynch urged Americans not to make violence the "new normal."

"This has been a week of profound grief and heartbreaking loss," she said. "After the events of this week, Americans across our country are feeling a sense of helplessness, of uncertainty, and of fear. These feelings are understandable and they are justified. But the answer must not be violence."

The shootings put other cities on alert. The NYPD's Counterterrorism Bureau said it was "monitoring the developing events" in Dallas, and Boston police said all its patrols would be conducted by two-officer units "in the best interests of officer safety."

Abbott ordered flags statewide to be lowered to half-staff in honor of the victims, and the governor’s mansion would be lit in blue Friday night.

“Any police officer in the state of Texas, you have the respect of a grateful state. And you have a governor who has your back,” Abbott said Friday.

Brown said his force was "heartbroken."

"We're hurting. Our profession is hurting. Dallas officers are hurting," he said. "There are no words to describe the atrocity that occurred to our city. All I know is that this must stop, this divisiveness between our police and our citizens."