DALLAS - Thousands of protesters marched in US cities late Friday, one day after a black extremist shot dead five cops who were protecting a peaceful march against police brutality in Texas.

President Barack Obama said he will cut short a foreign trip and visit Dallas next week as the shooting rampage by the black army veteran, who said he wanted to kill white cops, triggered urgent calls to mend troubled race relations in the United States.

While many remembered the slain officers, anger simmered as crowds overnight Friday to Saturday protested the deaths of Alton Sterling in Louisiana and Philando Castile in Minnesota, two African-American men killed by cops. Video footage of their final moments went viral online.

“As Americans, we are wounded by all of these deaths,” Vice President Joe Biden said Saturday. “It’s on all of us to stand up, to speak out about disparities in our criminal justice system — just as it’s on all of us to stand up for the police who protect us in our communities every day,” he said.  Biden praised the slain officers, whom he said joined the force because they thought they could help. “So when an assassin’s bullet targeted the police force in Dallas, it touched the soul of the nation,” he said. Five officers were shot dead in the late Thursday shooting, with seven other officers and two civilians wounded.

Police found bomb-making materials and a weapons cache at the home of 25-year-old Micah Johnson, a Dallas area resident who gunned down the officers before being killed in a standoff with police.

While the White House ruled out any link between the gunman and known “terrorist organizations,” Johnson’s Facebook page ties him to several radical black movements listed as hate groups.

Described to police as a “loner” with no prior criminal record, Johnson served as a US Army reservist for six years, including a tour of duty in Afghanistan. Johnson told negotiators before he died that he wanted to kill white cops in retaliation for the fatal police shootings in Louisiana and Minnesota.

Leaders of the Black Lives Matter protest movement condemned the Dallas violence, but vowed to uphold planned weekend marches. The shooting revives an emotional debate over lethal use of force by police, and problems of alleged police bias towards racial minorities, especially African-Americans.

Vast crowds marched in US cities including Houston, New Orleans, Detroit, Baltimore, Philadelphia and San Francisco. One of the largest was in Atlanta, where protesters blocked a major road. In Phoenix, police in riot gear used pepper spray to disperse a large crowd that hurled rocks and threatened to block a highway. At least one person was arrested.

And in Rochester, New York, Police Chief Michael Ciminelli said that 74 people were arrested for blocking a street in what appeared to be a peaceful sit-in protest. Addressing a prayer service honoring the fallen officers, Dallas Mayor Mike Rawlings urged Americans to “step up” to heal the country’s racial wounds.

“We will not shy away from the very real fact that we as a city, as a state, as a nation are struggling with racial issues,” he told the crowd. Rawlings echoed Obama’s message that black lives matter — and so do “blue” lives, those of police officers.

“We must step up our game and approach complicated issues in a different way,” Rawlings said. “And race is complicated.”

Obama, who ordered flags on government buildings lowered to half-mast for five days, said that there was “no possible justification” for violence against police. The president commented on the attacks from Warsaw, where he was attending a NATO summit. He condemned the shootings as “vicious, calculated and despicable.”

The White House said Obama would return home late Sunday, one day ahead of schedule, and visit Dallas early next week. The Dallas shootings sparked chaos as people scrambled for safety during a march by several hundred demonstrators in the city of 1.2 million.

The ambush marks the single biggest loss of life for law enforcement in the United States since the September 11, 2001 terror attacks. “This must stop — this divisiveness between our police and our citizens,” Dallas police chief David Brown said.

Johnson was killed by a bomb robot sent in by officers after hours of negotiations and an exchange of fire. “This was a well-planned, well-thought out, evil strategy,” said Brown of the gunman. Bomb-making materials, weapons and ammunition were found in Johnson’s home.

“He said he was upset about the recent police shootings,” Brown said. “The suspect said he was upset at white people. The suspect stated he wanted to kill white people, especially white officers.”

Earlier, officials said three other people had been detained, but it was unclear if any remained in custody. US Homeland Security Secretary Jeh Johnson said the gunman appeared to have acted alone.

The gunman told police he was not affiliated with any organized groups. But groups that Johnson “liked” on Facebook included several organizations listed as hate groups by the Southern Poverty Law Center, which monitors such movements in the United States.

On his Facebook page, Johnson appears with his fist raised wearing an African style tunic against the backdrop of the red, black and green Pan-African flag, all reminiscent of the US black power movement of the 1960s.