Thousands have taken to the streets of US cities to denounce police killings of two black men this week, a day after a man killed five police officers at a similar demonstration in the city of Dallas.

Protesters on Friday clogged roadways in New York City, Atlanta and Philadelphia, and events in San Francisco and Phoenix also drew large crowds.

There were no immediate reports of injuries or significant numbers of arrests, though in Phoenix police in riot gear used pepper spray on protesters, some of whom threw rocks at officers, local media said.

Videos posted online showed protesters also gathering in Baton Rouge, Louisiana, where 37-year-old Alton Sterling was shot dead by police early on Tuesday.

READ MORE: Does Black Lives Matter really matter?

The largest demonstration appeared to be in Atlanta, where thousands of people marched, chanting and waving signs demanding justice, video posted to social media showed.

Footage from broadcasters showed a large crowd facing off with dozens of police vehicles blocking a local interstate highway.

'No justice, no peace'

Atlanta Mayor Kasim Reed tweeted that the rally was largely peaceful, though about 10 people had been arrested.

Friday was the second day of demonstrations against the killings since the fatal shootings of Sterling and of 32-year-old Philando Castile near St Paul, Minnesota.

The killings again stoked racial tension that has flared repeatedly across the country since the 2014 killing of Michael Brown, an unarmed black teen, by a white police officer in Ferguson, Missouri.

Castile was killed by police during a traffic stop on Wednesday, and his girlfriend broadcast live footage of the immediate aftermath of his shooting on Facebook, drawing millions of viewers.

Dallas attack: Former US soldier identified as suspect

Sterling was killed on Tuesday during an altercation with two white police officers outside a shop. A gruesome video of that incident caused uproar on social media.

"No justice, no peace, no racist police," demonstrators shouted late on Friday in Baton Rouge, where state and local police in riot gear tried to keep them from blocking a busy roadway.

Thursday's demonstrations over the killings of Sterling and Castile were largely peaceful until gunfire rang out at a Dallas rally that was winding down.

Authorities said 25-year-old Micah Johnson, a black American soldier who had fought in Afghanistan, launched a sniper attack that killed five police officers and wounded nine other people. According to police, he later said he had wanted to "kill white people".

Police killed Johnson with a bomb-carrying robot after cornering him in a parking garage, ending an hours-long standoff.

Race relations: A US election issue

Source: Reuters