Dallas Ambush Shooting by Lone Gunman Was 'Well Planned' and 'Thought Out,' Police Say Officers were shot during a protest over police killings of two black men.

 -- The ambush that left five Dallas law enforcement officers dead and seven more injured was "a well-planned, well-thought-out, evil tragedy" by a lone suspected gunman — a former Army reservist — who wrote manifestos on how to shoot and move, according to the mayor and police chief of Dallas.

"We're hurting. Our profession is hurting. Dallas officers are hurting," Police Chief David Brown said. "We are heartbroken. There are no words to describe the atrocity that occurred to our city."

Micah Xavier Johnson, 25, who was identified as the suspected gunman, died in the overnight standoff with police. Officials said that it appears that Johnson, who had no criminal history, acted alone.

Homeland Security Secretary Jeh Johnson said the suspected gunman does not appear to have any "links to or inspiration from any international terrorist organization."

Police said that some have described the former Army reservist as a loner.

"He had written manifestos on how to shoot and move and he did that, and did his damage," Mayor Mike Rawlings said. "We believe now that the city is safe and the suspect is dead and we can move on to healing."

While three other suspects — two men and one woman — were detained by police after the shootings, the mayor said today they have since been released.

Two law enforcement sources told ABC News that police have found no connection between Johnson and the three people detained.

Police said Johnson told hostage negotiators that he was angry about recent fatal shootings of black men by police elsewhere in the United States and that he wanted to kill white people, especially police officers.

The gunman "expressed anger for Black Lives Matter" and told a hostage negotiator he "wanted to kill [police] officers," Brown said today.

Police spent hours negotiating with Johnson before detonating an explosive strapped to a robot and killing him.

The mayor said Johnson was given options to give himself up peacefully, without being harmed, but he chose not to.

Johnson served as an Army reservist until April 2015, defense officials said. He was trained and served in the Army Reserve as a carpentry and masonry specialist, they said.

He was deployed to Afghanistan from November 2013 to July 2014, according to his service record. He had the rank of a private first class.

LM Otero/AP Photo

Among the five officers killed was a newlywed, married just two weeks ago to a fellow officer. Another victim was the father of a toddler daughter. A third had been a police officer in Michigan.

One of the slain officers was Patrick Zamarripa. His father posted on Facebook, "My son is a police officer in Dallas he was working there the rally in downtown where my son was shot and killed by a sniper along with four other police officers ... Need prayers to get through this."

President Barack Obama called the Dallas shooting a "vicious, calculated, despicable attack" while speaking to reporters this morning in Warsaw, Poland. He described the killings as a "tremendous tragedy" and "senseless murders."

"We will learn more about their twisted motivations," he said of the suspects. "Let's be clear: There is no possible justification."

Two civilians were also injured in the shootings, which happened as people demonstrated in downtown Dallas after the fatal shootings this week by police officers of two black men: Alton Sterling in Louisiana and Philando Castile in Minnesota.

LM Otero/AP Photo

The chaos erupted just before 9 p.m. Central time on Thursday, when at least two snipers in separate elevated positions opened fire on police officers at the demonstration, officials said.

The Rev. Jeff Hood, one the organizers of the protests, said the goal of the rally was to create "a space where anger could be let out. We were interested in creating a space where people could grieve. We were interested in creating a space where people could network to face head-on the problem of police brutality in our country."

He added, "We left that rally in a nonviolent fashion. After leaving the rally, I heard 'Pop, pop, pop, pop, pop' in succession. Immediately when I heard the shots, I looked up, and I saw what I believe were two police officers that went down."

"The sergeant ran towards the shooting. I ran the opposite direction … was screaming, 'Run, run! Active shooter, active shooter! Run, run!' And I was trying to get folks out as fast as I could … During that moment, I lost track of my wife. I didn't find her again for three and a half hours," Hood said.

"I spent those three hours talking to people asking the question, 'Why, why? Why is this happening?' The only answer I know now and the only answer I knew then was turn to love. We've got to turn to love. We got to stop shooting," he said. "This is a devastating time for the city of Dallas. It's a devastating time for us as activists and organizers."

Texas Gov. Greg Abbott said in an open letter in The Dallas Morning News today, "Justice will be served, but justice is small solace for the families left behind. We mourn for the families of the fallen, for the law enforcement community and for our nation."

"Respect for our law enforcement officers must be restored in our nation … For law enforcement officers to stand in front of us and all that threatens, we must stand behind them," he wrote. "Every life matters. With each innocent life lost, we lose more of our humanity."

"I ask for your prayers — for our law enforcement officers, for the city of Dallas, for our state and for our nation," Abbott said. "I have faith in the goodness of Texas, of America. For in the end, evil always fails."

The shooting deaths of Sterling and Castile — parts of which were captured on video — sparked outrage and led to demonstrations across the country. The Department of Justice is investigating Sterling's death and is monitoring the investigation into Castile's.

Get real-time updates as this story unfolds. To start, just "star" this story in ABC News' phone app. Download ABC News for iPhone here or ABC News for Android here.