Two U.S. service members and two American contractors were killed by a suicide bomber early Saturday on Afghanistan's Bagram Airfield, the U.S. military said.
Sixteen American troops and one Polish soldier were wounded in the blast.
The attack was blamed on "an apparent suicide bomber," Defense Secretary Ash Carter said in a statement.
The explosion occurred around 5:30 a.m. local time, according to a statement released by officials with Operation Resolute Support, as the U.S.-led mission in Afghanistan is now known. Bagram is one of the U.S. military's few remaining installations there.
Officials have not identified the casualties. Response teams are continuing to treat the wounded and investigate the incident, officials said.
The Taliban claimed responsibility for the attack, which they said was carried out by a suicide bomber inside the base, The Associated Press reported. A spokesman for the insurgent group said the attack had been planned for four months.
"To the family and friends of those who lost their lives today, we share your loss, and our thoughts are with you," Army Gen. John Nicholson, the top U.S. commander in Afghanistan, said in a prepared statement. "For the family and friends of those wounded in today's attack, let me assure you they are receiving the best care possible, and we will keep them in our thoughts today."
Saturday's attack, he said, will not deter the U.S.-led NATO mission to train, advise and assist the Afghans to "create a better Afghanistan."
Pockets of Afghanistan remain violent even as the U.S. military has reduced its footprint there and scaled back its overall focus, now limited to counter-terrorism operations and supporting the Afghan security forces. Last week, two American service members and 26 civilians were killed during a battle in Kunduz province.
Today, about 8,400 U.S. troops are spread between only a handful of bases. Bagram, which was a major hub for U.S. operations throughout the war, is one of the few installations still being used by U.S. forces. The others include Kandahar Airfield and cluster of bases in Kabul, Afghanistan's capital. At the height of the war, there were more than 800 American bases and outposts across the country.