DALLAS, TEXAS -- A peaceful protest in Dallas over the recent videotaped shootings of black men by police turned violent Thursday night as a gunman shot at officers, killing five and injuring seven, as well as two civilians, making it the deadliest day for U.S. law enforcement since 9/11.

Dallas Police Chief David Brown originally blamed "snipers," however Homeland Security Secretary Jeh Johnson said that there appeared to have only been one gunman'. Authorities have said that 25-year-old Army veteran Micah Johnson had been involved in a standoff with police and was killed by a robot-delivered bomb. 

Dallas Mayor Mike Rawlings said at a news conference Friday that he believes the city is safe and residents can start healing now.

Authorities say Johnson had bomb-making materials, ballistic vests, rifles, ammunition, and a personal journal of combat tactics at his home. They say detectives are in the processing of analyzing the information contained in the journal.

Authorities said that Johnson told officers he was upset about recent shootings and wanted to kill whites, "especially white officers." His race has not been released, nor have the races of the officers who were shot. Video from the scene showed protesters marching along a street when shots erupted and the crowd scattered, seeking cover.

Officers crouched beside vehicles, armored SWAT team vehicles arrived and a helicopter hovered overhead. 

Brown said at a prayer service Friday that the attack was "well planned" and that the force "won't rest until we bring everyone involved to justice." Dallas Mayor Mike Rawlings said that it's within people's rights to protest, but that one thing it can do is "put our police officers in harm's way."

--Dallas Sniper Attack Full Coverage--

Two male suspects were taken into custody after a car chase, Brown said. A fourth suspect, a female, was arrested near the parking garage where the standoff was underway.

--Reaction:--

Texas Gov. Greg Abbott said that he wants any law enforcement officer to know that they have the respect of a grateful state.

"In this day and the coming days the primary message is one word: unity,” said Abbott. 

President Barack Obama has ordered flags lowered to half-staff to honor the 12 police officers and two civilians who were shot. Obama's proclamation Friday applies to American flags flown at the White House and on all public buildings and grounds, military installations and Navy vessels. It extends through sunset Tuesday, July 12.

Center for Media Justice director Malkia Cyril defended the Black Lives Matter movement, saying it "advocates dignity, justice and freedom, not the murder of cops.''

The Rev. Jesse Jackson has condemned the fatal shooting of five police officers in Dallas as a "cowardly and insane act of terrorism.''  The black civil rights advocate said at a Friday news conference in Chicago that the shootings, which apparently came in reaction to the killing by white police officers of black men in Louisiana and Minnesota, do not reflect "our struggle for justice whatsoever.'' 

He says his heart is "heavy at the thought of innocent police being killed." He also spoke with Diamond Reynolds, who livestreamed to Facebook a video in the immediate aftermath of the fatal shooting of her boyfriend, Philando Castile, by police in Minnesota on Wednesday.

--Previous Shootings:--

Baton Rouge, Louisiana: Alton Sterling

Alton Sterling, 37, was fatally shot Tuesday during a struggle with two police officers outside of a convenience store where he was selling CDs. Sterling, a father of five, was black; both officers are white. Police said that Sterling, who was a convicted felon and barred from legally carrying a gun, was armed and an eyewitness said he had a gun in his pocket.  Sterling's shooting was caught on cellphone video by an anti-violence group. It quickly spread online and sparked several days of protests in the city where 54 percent of the population is black and more than 25 percent live in poverty. Both officers involved, four-year member of the department Blane Salamoni and Howie Lake II, who was on the force for three years, were placed on administrative leave and had prior ``use of force'' complaints. Baton Rouge Police Chief Carl Dabadie Jr. has said there are still questions about what happened. The U.S. Justice Department has opened a civil rights investigation into the shooting. In announcing the Justice Department investigation, Democratic Gov. John Bel Edwards was accompanied by black Democrats from Baton Rouge who praised him and others for quickly asking the federal government to get involved.

Falcon Heights, Minnesota: Philando Castile

Philando Castile, a black 32-year-old cafeteria supervisor at a public school, was shot Wednesday night in suburban St. Paul, Minnesota, during a traffic stop that involved two officers. He died a short time later at a hospital. Castile's girlfriend, Diamond Reynolds, says he was shot while reaching for his wallet. 

Reynolds began livestreaming on Facebook from the vehicle shortly after Castile, who is bloodied and moaning before slumping in the driver's seat, had been shot. She describes being pulled over for a "busted tail light'' as an officer with the St. Anthony Police Department, which polices Falcon Heights, points a gun into the car and speaks with her, saying "I told him not to reach for it.''

The officers involved, Jeronimo Yanez and Joseph Kauser, both had been with the St. Anthony Police Department for four years and were put on administrative leave. Yanez fired the shots. Their races are not known, though Reynolds described the officer who shot Castile as Asian. The Minnesota Bureau of Criminal Apprehension, which is leading the investigation, has not released details about the incident.

The state Bureau of Criminal Apprehension is investigating the shooting.

WATCH full press conference by Dallas Mayor Mike Rawlings and Texas Governor Ken Paxton: