"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.
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.
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.
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.
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.
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.
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.
"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.