Several hundred bikers gathered in Baton Rouge on Tuesday and rode in a procession to the city's police headquarters in a show of support for the policemen shot and killed by a gunman at the weekend.

The bikers, many carrying U.S. flags and revving their engines, rode past the gas station where the policemen where killed en route to the police station.

Spectators gathered on the side of the streets to cheers them on. One woman carried a banner reading 'cops lives matter.'

President Barack Obama has told law enforcement officials that Americans recognize, respect and depend upon the difficult and dangerous work they do, a rallying call of support following the ambush killings of eight officers in Dallas and Baton Rouge.

Three police officers were gunned down in Louisiana's state capital on Sunday by a U.S. Marine Corps veteran with ties to an African-American anti-government group, authorities said. On July 7, another former U.S. serviceman espousing militant black nationalist views killed five Dallas officers.

Authorities identified the Baton Rouge gunman as former Sergeant Gavin Long of Kansas City, Missouri, an Iraq war veteran, and said he seemed determined to slay as many police officers as possible before a SWAT team marksman cut short his attack.

The single gunshot that killed Long, 29, was fired by an officer from about 100 yards away, police have said as they deepened their investigation into the second racially charged armed assault on U.S. law enforcement this month.