A fifth police officer has died in Dallas after snipers opened fire at a police brutality protest.

“We just lost another. Officer Down,” tweeted the Dallas Police Association.

Three people have been taken into custody and police are in a standoff with one armed man in a garage.

The gunfire started at around 8.45pm local time on Thursday while hundreds of people were gathered to protest over fatal police shootings this week in Baton Rouge, Louisiana, and suburban St Paul, Minnesota.

Three people are in custody and police were negotiating with a suspect in a parking garage who was exchanging gunfire with officials, Dallas Police Chief David Brown told AP early on Friday morning.

The suspect is not co-operating and has told negotiators he intends to hurt more law enforcement officials, Mr Brown said.

Follow the latest news at The Independent's live blog here

Mr Brown told reporters the snipers fired on the officers “ambush style” from “elevated positions”.

Mayor Mike Rawlings said one member of the public was wounded in the gunfire.

Protests were also held in several other cities across the country on Thursday night after a Minnesota officer shot Philando Castile dead while he was in a car with a woman and a child on Wednesday. The aftermath of the shooting was livestreamed in a widely shared Facebook video.

A day earlier, Alton Sterling was shot in Louisiana after being pinned to the pavement by two white officers. That, too, was captured on video on a mobile phone.

One suspect exchanged gunfire with police, and was arrested early on Friday morning, police confirmed. A suspicious package was found near the suspect and a bomb squad has begun investigating the threat.

Another suspect labeled as a “person of interest” willingly turned himself into police. He was on the ground when shots first rang out, according to several reporters at the scene.

Two others were taken into custody early Friday morning, and during a standoff with police, a fourth told officers bombs were planted all across the city.