The Dallas gunman was plotting a major bomb attack, authorities said Sunday, urging calm as hundreds of people were arrested in weekend protests in US cities over police violence against African-Americans.
Demonstrators marched demanding justice for two black men shot dead by cops in Minnesota and Louisiana, their dying moments captured in video that went viral online.
Peaceful marches attracted large crowds in major US cities, but became especially unruly in St. Paul, Minnesota and Baton Rouge, Louisiana, where police killed the two men.
Scores of people were arrested in both cities on Saturday and Sunday.
The demos come days after black army Afghan war veteran Micah Johnson, 25, used a high-powered rifle to kill five police officers and wound seven in a sniper attack at a protest in Dallas, Texas late Thursday.
Johnson said before he was killed that he wanted to murder white cops in revenge for the black deaths.
Seeking to restore calm, President Barack Obama, scheduled to speak in Dallas at an inter-faith memorial service Tuesday, cautioned protesters against casting all police as racially biased.
The Dallas community's "unity is reflective of who we are as Americans" during these trying times, said Obama, speaking Sunday in Madrid.
The president, who cut short his European visit, will meet privately in Texas with the families of the five fallen police officers and those wounded.
At least 48 people were arrested Sunday in Baton Rouge, local media said, hours after Sheriff Sid Gautreaux said that 102 protesters had been arrested in late Saturday demonstrations.
Among them was Black Lives Matters activist leader DeRay McKesson, who livestreamed the incident. He was released on bond Sunday.
"The only people that were violent last night were the Baton Rouge police department," McKesson told reporters outside the jailhouse.
Gautreaux however said that one officer was injured late Saturday.
Protesters will not be "allowed to incite hate and violence, to engage in unlawful activities," said Louisiana Governor John Bel Edwards.
On Sunday police in armored cars and clad in riot gear confronted a crowd in what began as a peaceful march, the local The Advocate newspaper reported.
Police even used an ear-splitting, high-pitched siren in an attempt to disperse the crowd. Despite the tension, harsh words and arrests the protest remained peaceful, The Advocate said.
Separately in St. Paul, authorities were dealing with the aftermath of the late Saturday unrest, where 102 people were arrested when protesters blocked a freeway and attacked police with rocks, bottles, fireworks and a Molotov cocktail.
Twenty-one officers were injured in the hours-long melee, including one who suffered a broken vertebrae when a rioter dropped a 25-pound (11-kilogram) chunk of concrete on his head from an overpass, police spokesman Steve Linders said.
"What happened last night and early this morning does a disservice to those who have lost their lives this last week," St. Paul Mayor Chris Coleman said.
"This is not about grief, this is not about protest. This is about rioting. This is about violence."
St. Paul Police Chief Todd Axtell said some of the protesters turned into criminals, leaving him "absolutely disgusted."
Dallas Police Chief David Brown described chilling new details about Dallas shooter Johnson in a TV interview on Sunday.
He said that Johnson, who apparently sympathized with black militant organizations classified as hate groups, had been planning something -- and was urged to action by police killing the two black men.
A search of Johnson's Dallas-area home turned up bomb-making materials and a journal on military tactics.
Investigators believe that Johnson "had been practicing explosive detonations," and that he had enough explosives "to have devastating effects throughout our city and our North Texas area," Brown told CNN's "State of the Union."
Then he toyed with police during negotiations in a standoff.
"He just basically lied to us, playing games, laughing at us, singing, asking how many did he get and that he wanted to kill some more," Brown said.
At one point Johnson, apparently wounded in an exchange of gunfire with police, wrote the letters "RB" in his own blood on the wall.
Brown said it was not clear what those letters meant.