The police headquarters in the US city of Dallas, Texas, came under attack yesterday by an unknown number of gunmen who opened fire on officers.

Dallas Police Chief David Brown quoted witnesses as saying that as many as four suspects were involved in the initial shooting at about 00:30 and that at least one suspect fled the scene in what was described as an armoured van and became involved in a standoff with police in a car park.

Brown also confirmed that a number of bags were found outside the police HQ, at least one of which contained explosives including pipe bombs.

The police chief said that when police responded to reports of automatic gunfire, the van rammed a squad car and at least one person began shooting. The van drove off when the police returned fire and the police gave chase. The chase involved dozens of squad cars before the van stopped in a fast food restaurant car park in the city of Hutchins, some 10 miles south of Dallas, where there was another exchange of gunfire.

Brown said police negotiators had been in contact with one of the suspects inside the van, who identified himself as James Boulware. The van, which was disabled using a police rifle, appeared to have gun ports built into its sides.

The police chief said they had yet not been able to confirm the identity of the man, but also confirmed that police had responded previously to three incidents of domestic violence involving a man with that name.

Brown said that the suspect had told them that police had taken his son and had accused him of being a terrorist. The police chief said that the man then threatened to "blow us up."

Four bags were found scattered around police headquarters, at least one of which had explosives inside. It was one of these bags that later exploded when a police robot attempted to move it.

Police said another suspicious package was found under a police truck in the police headquarters' car park in addition to another one in a rubbish skip near a different police station in the city. Nearby residents were evacuated.

Joshua Guilbuad, whose apartment is opposite the police headquarters, told reporters he was woken by the gunshots.

"It sounded like approximately 200 gunshots going off across the street. Then we could see cars pulling up."

He said police told him and his flatmates to evacuate the building and shortly afterwards there was "a huge explosion which shook the glass in the windows".

"We are now in the basement of the building with no access to food or water," he said.

A video of the initial incident involving the van shown on social media showed a police officer approaching a black van with a flashlight as two other police cruisers pulled up behind the vehicle. The officer then abruptly turned and ran away and then a volley of gunshots could be heard.

In another video, the van could be seen ramming a police cruiser before gunfire rang out and the vehicle drove off.