KABUL, Afghanistan -- An explosion at a U.S. airfield in Afghanistan early Saturday killed Americans, Defense Secretary Ash Carter said.

Carter said in a statement that two U.S. service members and two U.S. contractors working at Bagram Air Field were killed by “an apparent suicide bomber.”

The explosion wounded 16 other U.S. service members and one Polish soldier at the base, Carter said.

The incident was being investigated, he said.

Get Breaking News Delivered to Your Inbox

“For those who carried out this attack, my message is simple,” Carter said. “We will not be deterred in our mission to protect our homeland and help Afghanistan secure its own future.”

An earlier statement from NATO’s Resolute Support mission said the blast happened around 5.30 a.m. and that “force protection and medical teams are responding to the situation.”

The Taliban claimed responsibility for the attack, which they said was carried out by a suicide bomber inside the base. Zabihullah Mujahid, a spokesman for the insurgent group, said the attack had been planned for four months.

The Taliban regularly fire rockets at Bagram from outside its perimeter.

Laborers employed at the base line up at the gates around dawn, said Abdul Wahid Sediqqi, spokesman for the governor of Parwan province, where the air field is based, adding that an attacker could have been among the men entering the base Saturday.