The mother of a man linked to an attack on Dallas police headquarters says that her son had a history of mental health problems but that she had no inclination he would become violent.

Jeannine Hammond told TV station KDFW Sunday she "never dreamed" her son James Boulware would attack police.

Police have said the suspect, who planted pipe bombs outside the headquarters and fired at officers early Saturday from an armoured van, told them he was James Boulware, but a medical examiner hasn't officially confirmed the suspect's identity.

Hammond told the TV station she was awarded custody of Boulware's young son on Monday.

She described him as "an excellent father" for a time, until his mental health worsened.

Dallas shooting

The shooter who opened fire on Dallas police headquarters declared himself to be James Boulware, seen here, but police were still working to confirm that. (Dallas County Sheriff's Department )

Boulware was shot and killed after he allegedly sprayed police headquarters with gunfire several hours earlier, just after midnight. Bullets pierced the windows of the building, but no officers were injured.

His father, James Boulware Sr., said his unemployed son recently lost his home, as well as custody of his son, who he said is 12 or 13. But he told CNN he thought his son would have directed his anger not at police but at his mother, who was granted custody of the boy in April.

The younger Boulware had spent several hours at the father's home in Carrolton, a Dallas suburb, a day before the shooting and talked about how well his recently purchased van drove.

He discussed a widely publicized video of a police officer in McKinney, Tex., pushing a black teenager to the ground and brandishing his gun at other teenagers. The father said he last spoke with Boulware by telephone about three hours before Dallas police said the shooting began.

Dallas police van detonation

Dallas police set off two controlled explosions just after noon CT in the armoured van of a man suspected of opening fire on their headquarters about 12 hours earlier. The man had declared the van was packed with military-grade C4 explosives, police said. (WFAA TV)

"Not being able to get a job and the legal system letting him down, (he) finally snapped," the elder James Boulware said in a telephone interview with The Associated Press.

Dallas Police Chief David Brown said the gunman officers negotiated with inside the van blamed police for having lost custody of his son and for "accusing him of being a terrorist."

"When the negotiation was on, he became increasingly angry and threatening, such that we were not only concerned with our officers there trying to contain the scene being shot by him at a moment's notice," but also people nearby, Brown said at a news conference.

APTOPIX Dallas Police Headquarters Shooting

A Dallas SWAT officer walks to his vehicle at the intersection of Interstate 45 and E Palestine Street, where police cornered the suspect in his van on Saturday. (Ashley Landis/The Dallas Morning News via AP)

Officers also found the man had planted pipe bombs outside police headquarters.

Authorities said the shooting miraculously left no one else dead or injured. Among the areas damaged inside: the front desk where the worker on duty had just gone to get a soft drink.

The suspect also fired on officers who drove up to confront him, riddling at least one squad car with bullets but not actually hitting anyone. Cellphone video shot from a nearby balcony or roof showed the suspect's dark-coloured van ram a squad car as gunshots rang out. At one point the man got out of his van and walked toward the entrance to the building firing his gun but turned around, according to Dallas Police Maj. Jeff Cotner.

Police would not speculate on why he retreated.

The van then fled, eventually stopping in a restaurant parking lot in the suburb of Hutchins, where the standoff ensued until the police sniper shot and killed the man.

Investigators found a package of pipe bombs in the parking lot at police headquarters and at least two more pipe bombs in the van, police said.

Wary that the van may have been rigged with explosives, police used a camera-equipped robot to inspect it rather than have officers approach it immediately, which was why it took several hours to confirm the suspect was dead.

After he was confirmed dead, the van erupted in flames while the authorities were detonating the suspected ordnance inside.

With files from CBC News