A Taliban suicide bomber dressed as a laborer blew himself up at the NATO air base at Bagram north of the Afghan capital Kabul on Saturday, killing four Americans and wounding at least 17 people in one of the bloodiest attacks against US forces since President Obama took office.
Two US military service members and two US contractors were killed, and 16 other US service members were wounded, along with a Polish soldier who was part of the NATO mission, said US Defense Secretary Ash Carter in a statement.
"For those who carried out this attack, my message is simple. We will not be deterred in our mission to protect our homeland and help Afghanistan secure its own future," Secretary Carter said.
It was the deadliest attack on US soldiers in the country in almost a year, since a suicide bomber on a motorcycle killed six American troops on patrol near Bagram in December 2015. Two years earlier, a rocket attack killed four Americans and wounded six others.
Carter said the Pentagon will investigate Saturday's attack to determine what steps could be taken to improve protection for the base.
The attack, which was claimed by the Taliban, underlines the foreign policy challenge that will face US President-elect Donald Trump when he takes office in January.
Mr. Obama had originally hoped to have all US forces out of the country by the end of his term, but was forced to abandon that goal as Afghan forces struggled to contain the Taliban insurgency.
Under current plans, 8,400 US troops will remain as part of the Resolute Support operation and a separate US counterterrorism mission, leaving it to Mr. Trump to decide future strategy.
Waheed Sediqqi, spokesman for the Parwan provincial governor, said the bomber managed to enter the heavily protected site, the largest US base in Afghanistan, and was standing in a queue with Afghan laborers when he detonated a suicide vest.
The NATO-led Resolute Support mission response teams at the airfield were treating the wounded and investigating the incident.
It follows a suicide attack on the German consulate in the northern city of Mazar-i-Sharif late on Thursday night that killed four people and wounded more than 100 others. That attack was retaliation for air strikes near the northern city of Kunduz last week which killed more than 30 civilians.
The Taliban's spokesman, Zabihullah Mujahid, said Saturday's attack, which he said had been planned for four months, had caused heavy casualties, killing 23 Americans and wounding 44. The movement often exaggerates the number of casualties caused by its operations.
(Additional reporting by James Mackenzie and Roberta Rampton; Editing by Muralikumar Anantharaman, Hugh Lawson and Leslie Adler)