(Adds background on Johnson, quotes from victim, former Army unit, details from Baton Rouge)

* Gunman improvised to attack police during march

* Police chief defends use of robot to kill sniper

* Hundreds of people arrested in new protests

By Brian Thevenot and Erwin Seba

DALLAS, July 10 (Reuters) - The U.S. military veteran who fatally shot five Dallas police officers was plotting a larger assault, authorities said on Sunday, disclosing how he also taunted negotiators and wrote on a wall in his own blood before being killed.

Micah X. Johnson improvised instead and used "shoot-and-move" tactics to gun down the officers during a demonstration on Thursday evening, Dallas Police Chief David Brown told CNN. It was the deadliest day for U.S. law enforcement since the Sept. 11, 2001, attacks.

Brown said a search of Johnson's home showed the gunman had practiced using explosives, and that other evidence suggested he wanted to use them against law enforcement.

"We're convinced that this suspect had other plans," he said, adding that last week's fatal police shootings of two black men in Minnesota and Louisiana led the 25-year-old Texas shooter to "fast-track" his attack plans.

Johnson, a black veteran who served in Afghanistan, took advantage of a spontaneous march that began toward the end of the protest over those killings. Moving ahead of the rally in a black Tahoe SUV, he stopped when he saw a chance to use "high ground" to target police, Brown said.

Before being killed by a bomb-equipped robot, Johnson sang, laughed at and taunted officers, according to Brown, telling them he wanted to "kill white people" in retribution for police killings of black people. "He seemed very much in control and very determined to hurt other officers," the police chief said.

SURPRISE ATTACK

Brown said police had been caught off guard when some protesters broke away from Thursday's demonstration, and his officers were exposed as they raced to block off intersections ahead of the marchers.

Johnson's military training helped him to shoot and move rapidly, "triangulating" his fire with multiple rounds so that police at first feared they were facing several shooters.

Brown defended the decision to use a robot to kill him, saying that "about a pound of C4" explosive was attached to it. He added Johnson scrawled the letters "RB" in his own blood on a wall before dying.

"We're trying to figure out through looking at things in his home what those initials mean," the police chief said.

The U.S. Department of Defense and a lawyer who represented Johnson did not return requests for information on his military history or the status of his discharge.

Several members of Johnson's former Army unit, the 420th Engineer Brigade, exchanged comments on Facebook.

"Makes me sick to my stomach," wrote one, Bryan Bols.

Speaking at a local hospital, wounded mother Shetamia Taylor sobbed as she thanked police who shielded her and her son as the bullets began to fly.

At the Cathedral Shrine of the Virgin of Guadalupe in downtown Dallas, Roman Catholic parishioners gathered on Sunday for their weekly service and to remember the fallen officers.

"I would like you to join me in asking: 'Who is my neighbor?'" the Rev. Eugene Azorji, who is black, told the congregation. "Those who put their lives on the line every day to bring a security and peace, they represent our neighbor."

A candlelight vigil is due to be held at 8 p.m. on Monday in Dallas City Hall plaza.

PROTESTS AND ARRESTS

The mass shooting amplified a turbulent week in the United States, as the issues of race, gun violence and use of lethal force by police again convulsed the country.

Even as officials and activists condemned the shootings and mourned the slain officers, hundreds of people were arrested on Saturday as new protests against the use of deadly force by police flared in several U.S. cities.

Particularly hard hit was St. Paul, Minnesota, where 21 officers were injured as police were pelted with rocks, bottles and fireworks, officials said.

Protesters faced off with police officers wearing gas masks on Sunday evening in Baton Rouge, Louisiana.

Three countries have warned their citizens to stay on guard when visiting U.S. cities rocked by the protests.

Speaking in Madrid during a European tour, U.S. President Barack Obama said attacks on police over racial bias would hurt Black Lives Matter, a civil rights movement that emerged from the recent police killings of African-Americans but has been criticized for vitriolic social media postings against police, some of them sympathetic to Johnson.

"Whenever those of us who are concerned about failures of the criminal justice system attack police, you are doing a disservice to the cause," the United States' first black president told a news conference.

(Additional reporting by Ernest Scheyder, Jason Lange, David Bailey, Ruthy Munoz and Lisa Garza; Writing by Daniel Trotta and Daniel Wallis; Editing by Paul Simao and Peter Cooney)

Our Standards: The Thomson Reuters Trust Principles.