KABUL, Afghanistan — As their negotiators resumed peace talks with American diplomats, Taliban militants on Wednesday set off a car bomb and penetrated a medical facility attached to Bagram Air Base, the largest United States military base in Afghanistan, killing at least two people and wounding at least 73, officials said.

The daring attack on the base — which President Trump visited recently — lasted nearly 12 hours after the initial explosion, and it was bound to complicate the negotiations. After a year of talks, the two sides had been on the verge of announcing an agreement in September when President Trump called off the negotiations, citing a Taliban bombing that killed an American, a NATO soldier and nearly a dozen Afghans.

In the attack on Wednesday, a vehicle laden with explosives targeted the southern part of the base, the site of a medical facility that was under construction. Several attackers then entered the base, engaging in a firefight with Afghan and coalition forces, Afghan officials said.

Soon after the initial attack, a spokesman for the American-led NATO mission said the assault had been repelled. But later Wednesday, nearly 10 hours after the first explosion, the spokesman said that some fighters were still holed up in the medical facility. He said the medical facility had been badly damaged, but he insisted the air base defenses were not breached.