(CNN) A man unleashed a barrage of gunfire on Dallas' police headquarters and planted explosives outside the building early Saturday -- narrowly failing to wound anyone -- leading to a chase to a suburb that ended with SWAT officers killing him in his parked van at a restaurant parking lot.

Police shot him through the windshield of the armored van about an hour before dawn after he made more threats, sometime after they chased him to the lot outside the Jack in the Box restaurant in the suburb of Hutchins, authorities said.

But police didn't confirm his death until the early afternoon , with a bomb squad needing to inspect the vehicle after the suspect told them that the vehicle contained explosives.

"We believe this suspect meant to kill officers," police Chief David Brown told reporters. "We barely survived the intentions of this suspect."

Before he was shot, the suspect ranted to police by phone, identifying himself as James Boulware, and alleging police were responsible for his child having been taken from him, Brown said.

Police have said that they couldn't confirm that the name was the suspect's real identity.

Dallas-area resident Jim Boulware told CNN's Sara Sidner that police and agents from the FBI and ATF came to his house and told him that his son, James, had been killed after the standoff.

Jim Boulware said he thought his son would have directed his anger not at police but at his mother, who was granted custody of James Boulware's son in April.

Authorities wanted to search the house, Jim Boulware said, because his son visited the home a few hours before the shooting.

The attack began shortly after midnight, with the man firing an assault weapon and then a shotgun from the outside, riddling police cars and the windows of the headquarters, which sits across the street from a large apartment and office complex . Dallas Deputy Police Chief Gilberto Garza said at times the suspect was on foot as he fired an automatic rifle.

"He was always in or just outside his van," the deputy chief said.

Bullet holes mark where the #DallasPDShooting suspect was "on foot" shooting at the headquarters. Used automatic gun pic.twitter.com/F9dkBza4ax — Nick Valencia (@CNNValencia) June 13, 2015

Officers, staffers and perhaps others narrowly avoided being shot. The chief said rounds hit not only an occupied squad car but also the police headquarters' front lobby, its information desk and the building's second floor.

One lobby staffer had just risen from a desk to get a soda -- and bullet holes there suggest that the worker would have been shot otherwise, Brown said.

Bullets might have been whizzing near residents across the street, too. Rick Birt, who lives in the South Side on Lamar complex, was taking a phone video of the gunfire from his open apartment window.

"I heard snaps overhead, so I could tell that was rounds coming in our direction," Birt, a former Marine, told CNN.

Picture of squad car that was shot at. No officers were injured. pic.twitter.com/vfT2nCiJzP — Dallas Police Depart (@DallasPD) June 13, 2015

Parts of the initial attack were caught on video by several people nearby, and the police chief said he believed the sounds indicated some of the gunfire came close to those making the recordings. But based on the suspect's calls to police, "we think he was specifically targeting police officers," Brown said.

The attacker also planted at least one set of pipe bombs in a bag outside, designed to "explode upon touch," Brown said.

Police returned fire and gave chase. Video recorded by a witness and aired on CNN shows the dark van ramming the nose of a police car before retreating in reverse.

Chase, another shootout, and standoff

After the shootout at police headquarters, the suspect called 911 and gave a four- to five-minute rant, accusing of police of being to blame for him losing custody of a child, Brown said.

Photos: Attack on Dallas Police Photos: Attack on Dallas Police The van used by a lone shooter to attack and then flee Dallas Police Headquarters catches fire outside a fast-food restaurant on June 13, in Hutchins, Texas. Authorities used controlled charges to discharge pipe bombs in the van after the shooter reportedly unleashed multiple rounds and planted explosive devices around the station before leading police on a chase that ended in a standoff in the parking lot of the restaurant. Hide Caption 1 of 15 Photos: Attack on Dallas Police Police use a robot to gain access to the suspect's van, which authorities believed was rigged with explosives. Hide Caption 2 of 15 Photos: Attack on Dallas Police Evidence markers sit by bullet casings on a sidewalk near the police headquarters. Hide Caption 3 of 15 Photos: Attack on Dallas Police FBI evidence response team members look down at a piece of marked evidence on the street in front of Dallas police headquarters. Hide Caption 4 of 15 Photos: Attack on Dallas Police A sniper and a tactical officer take up positions on the shoulder of Interstate 45 at Dowdy Ferry Road. Hide Caption 5 of 15 Photos: Attack on Dallas Police Police setup a remotely operated robot during the standoff. Hide Caption 6 of 15 Photos: Attack on Dallas Police A Dallas County Sheriff's officer directs traffic at the intersection of Dowdy Ferry Road and Interstate 45. Hide Caption 7 of 15 Photos: Attack on Dallas Police Police block the intersection of Dowdy Ferry Road and Interstate 45 near where the suspect was barricaded in a van. Hide Caption 8 of 15 Photos: Attack on Dallas Police Police officers walk down Belleview Street on June 13, one block away from Dallas Police Department headquarters, as they search the area after the early morning attack on the building. Hide Caption 9 of 15 Photos: Attack on Dallas Police Dallas police officers search Belleview Street near the headquarters. Hide Caption 10 of 15 Photos: Attack on Dallas Police Officers check a newspaper rack. At least two pipe bombs that were found outside the police headquarters after the initial shooting. Hide Caption 11 of 15 Photos: Attack on Dallas Police A resident walks his dog past police blocking the road near Dallas Police Department headquarters. Hide Caption 12 of 15 Photos: Attack on Dallas Police Dallas police released a photo of a squad car struck by bullets. No officers were injured. Hide Caption 13 of 15 Photos: Attack on Dallas Police Dallas police posted on Twitter this image of damage to the headquarters. Hide Caption 14 of 15 Photos: Attack on Dallas Police Bullet holes can be seen in the windows of the headquarters. Hide Caption 15 of 15

Police later found his number and called him back, eventually allowing SWAT officers to negotiate.

Officers pursued the van to the restaurant parking lot in Hutchins -- roughly 13 miles southeast of the Dallas police headquarters -- and the man opened a van door and again shot at police, injuring no one, Brown said.

After a gunfire exchange, police called the man for negotiations.

JUST WATCHED Dallas police: Bomb exploded near headquarters Replay More Videos ... MUST WATCH Dallas police: Bomb exploded near headquarters 02:54

Shortly after 4:30 a.m. (5:30 a.m. ET), police used a .50-caliber rifle to hit the engine block, disabling the van, Brown said, because the man on the phone had been increasingly hostile and agitated. Police didn't want him to drive away and threaten anyone else, Brown said.

About a half hour later, SWAT snipers shot the man through the van's front windshield, Brown said.

JUST WATCHED Witness in Dallas police shooting describes the scene Replay More Videos ... MUST WATCH Witness in Dallas police shooting describes the scene 03:16

The man had become increasingly angry and made threats before cutting off the negotiations, the chief said.

The suspect claimed that the van contained C-4 plastic explosives, according to Brown.

"They (SWAT officers) made the call, and I believe it's the right call ... to stop his violence," Brown said.

Authorities found at least two more pipe bombs in the van, police said.

Video from CNN affiliate KTVT showed an explosion near the van, after police said they would use "an explosive water charge" to neutralize any explosives inside.

Early Saturday afternoon, KTVT footage showed the van was on fire.

"During intentional detonation of susp(ect) ordnance, susp(ect) van caught fire and rounds are going off inside," Dallas police tweeted.

Officer almost tripped on bomb, 'wouldn't have survived'

Back outside headquarters, police found at least one package of pipe bombs. It was set to detonate upon touch, Brown said.

"(An officer), during the searching, almost tripped over it. If he had touched it, he wouldn't have survived," Brown said.

The package exploded when a bomb-squad robot tried to move it Saturday morning, police said.

Dallas police posted a tweet showing that vehicles were damaged in the blast.

This is where the Explosive Ordinance Robot attempted to move one of the bags. #DallasPDShooting pic.twitter.com/mgbgytBhWv — Dallas Police Depart (@DallasPD) June 13, 2015

Former Marine captured videog

The crackling sound of the Dallas shootout got the attention of Birt, the ex-Marine who lives across the street from the police headquarters with his wife.

JUST WATCHED Dallas police under fire: 'It sounded like a jackhammer' Replay More Videos ... MUST WATCH Dallas police under fire: 'It sounded like a jackhammer' 02:51

"We heard loud noises, my wife asked if I thought they were shots," he said. "I went over to the window and put one of them up. And we heard more shots being fired, and I turned to my wife and said, 'Yeah, that's definitely gunfire.'"

He got his cell phone and recorded video. After the van fled, police informed him and his wife that they and others to evacuate the building.

Dallas police said the complex's residents might have to stay away for hours, since officers needed to determine whether more bombs were planted in the area.

As for the suspect, investigators have no reason to believe the man had "any nexus to terrorism," Brown said.

Investigators are looking into whether a van sold in Newnan, Georgia, on eBay last week may be the van used in the Dallas attack, a source familiar with the investigation said. They are investigating, among other things, who may have purchased the vehicle.

Jim Boulware said his son took a bus last week to Georgia and bought a van.

Witnesses initially indicated up to four people attacked the Dallas police building. But Brown said investigators concluded that only one person was involved and that witnesses were describing the same person at different times and locations.