KABUL—Taliban militants detonated a vehicle bomb and then stormed a government building in central Kabul on Monday, leaving dozens of people dead in the latest convulsion of violence to hit Afghanistan.

The morning rush-hour blast, which shook the center of the Afghan capital and sent smoke billowing into the clear summer sky, came as the latest round of talks between U.S. and Taliban negotiators to end the nearly 18-year Afghan war entered a third day in the Gulf state of Qatar.

In an indication of how a handful of militants can paralyze much of a city, more than eight hours after the initial explosion police commandos were still battling militants holed up in high-rise apartment buildings near the site of the blast in the Puli Mahmood Khan district of the capital.

The rattle of automatic-weapons fire and the thud of explosions could be heard several blocks away, as armored vehicles carrying police reinforcements raced to the buildings surrounding the still smoldering blast site.

As the vehicles raced by, an elderly man, Aref Noorullah, sat hunched on the ground near the curb, his knees to his chest, wiping tears from his eyes with his scarf. He said he had walked across much of the city, a distance of more than 6 miles, after learning that his 38-year-old son, the father of seven children, had been killed in the blast. His son’s body was still half-buried in the rubble, and it would be hours before he could recover the remains.