AYN AL ASAD AIR BASE, Iraq — The first of several Iranian missiles to hit the American military base rammed into the airstrip, nearly destroying a guard tower where two young army specialists were on watch duty. Another crashed next to a dining hall and destroyed part of a building where some drone operators were still working.

The base, Ayn Al Asad, in western Iraq, was one of two hit last week in an Iranian attack in retaliation for the killing of Maj. Gen. Qassim Suleimani, the commander of Iran’s elite Quds Force. As flames, dust and debris filled the air and the building shook, the drone operators dived under their desks. The lights swung madly, and then went out.

They had remained in the building despite warnings of an imminent assault because they wanted to get their drones into the air so they would not be destroyed by the missiles, and because “we didn’t know if there was going to be any ground attack,” said First Sgt. Wesley Kilpatrick.

For the most part, they succeeded in preserving the drones.

Moments after the attack ended, one of the drone operators, Staff Sgt. Costin Herwig, 26, stumbled outside to look for his colleagues.