DALLAS — A gunman attacked Police Headquarters at the edge of downtown here from inside an armored van early Saturday, shooting at officers and leaving bags filled with pipe bombs around the building in a brazen assault that led to an hourslong standoff. Hours after negotiators who had tried to persuade him to surrender lost contact, the suspect was found dead in the van after being shot by a police sniper, the police said.

No officers or bystanders were killed or injured in the attack, which began outside the headquarters and spread to the parking lot of a restaurant in a suburb of Dallas.

After the suspect fled from Police Headquarters, officers pursued him and cornered him at the parking lot, where police snipers fired at the vehicle with .50-caliber rifles and disabled it. Negotiations went on until around 5 a.m., when a police sniper shot the suspect through the van’s windshield.

The police did not say whether the sniper fire caused the man’s death. His body was sent to the Dallas County Medical Examiners Office for an official determination.