The U.S. military veteran who fatally shot five Dallas police officers last week was plotting a larger assault, authorities said, disclosing how he had taunted negotiators and written on a wall in his own blood before being killed.

Protests against U.S. police tactics continued for a third straight day on Sunday, with scores arrested in Baton Rouge, Louisiana, after authorities warned that violence during street demonstrations over the fatal police shootings of two black men last week would not be tolerated.

RELATED:  Dallas police chief defends use of robot to kill gunman

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

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

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

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.

Johnson was killed by a bomb-equipped robot but Brown said before then he sang, laughed at and taunted officers, and said 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.

Brown said police were caught off guard when protesters broke away from Thursday's demonstration, and were thus 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 there were 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 said Johnson had 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," Brown 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.

RELATED:  Dallas shootings cast shadow over Obama trip to Spain

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

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

Protesters faced off with police officers wearing gas masks on Sunday evening in Baton Rouge. Media, citing Baton Rouge police, reported that at least 48 people were taken into custody after demonstrators clashed with police following a peaceful march to the state capitol.

In St. Paul, Minnesota, 21 officers were injured on Saturday when they were pelted with rocks, bottles, construction material and fireworks.

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.

At a Texas hospital, wounded mother Shetamia Taylor sobbed as she thanked police who shielded her and her son in Dallas as bullets flew.

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

RELATED:  Dallas police headquarters cordoned off after threat

"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 set for 8 p.m. on Monday in Dallas City Hall plaza.