AIN AL-ASAD, Iraq — U.S. commanders at the Iraqi military base targeted by Iranian missiles said Monday they believe the attack was intended to kill American personnel, an act that could have pushed the two powers closer to outright war.

The missile barrage last week against the sprawling Ain al-Asad air base in western Iraq left deep craters and the crumpled wreckage of living quarters and a helicopter launch site. At least two soldiers were thrown through the window of a meters-high tower, and several dozen U.S. troops were later treated for concussion as a result of the missile strikes, military officials on the base said.

"These were designed and organized to inflict as many casualties as possible," said Lt. Col. Tim Garland, commander of Task Force Jazeera and one of the most senior officials on the base that day.

He said the strikes were especially perilous because they came in waves, with up to 15 minutes between each. During those intervals, a rapid-response force was repeatedly on the move to assess blast sites and find colleagues who were feared hurt.

The attack lasted more than an hour and a half, commanders said, with explosions illuminating the landscape for miles. In interviews, more than a dozen troops described feeling the air turn warm as light filled the night sky and shock waves ripped through the air.

Lt. Col. Staci Coleman, who oversees airfield operations, described the absence of serious injuries as "miraculous."

In the hours that followed the attack, Iran called it "harsh revenge," saying it had killed dozens. Within a day, however, U.S. and Iraqi officials were reporting that nobody had died.

Accounts from inside the Trump administration have suggested that the absence of fatalities was a crucial factor in the president's decision not to escalate further. "All is well!" he posted in a tweet hours after the attack. But across Ain al-Asad, the testimony of witnesses and damage in several areas seemed to indicate that the lack of serious casualties was at least partly due to luck.

With tensions running high early last week after the U.S. killing of Iranian Maj. Gen. Qasem Soleimani in Baghdad, the al-Asad base had already been on high alert, expecting more of the kind of rocket attacks that have targeted U.S.-led coalition and Iraqi forces across Iraq for months. The base hosts about 2,000 troops, 1,500 of them from the U.S.-led coalition.

But at 11 p.m. Tuesday, another call came in, military officials recounted. They were told to expect an unprecedented attack on U.S. ground forces from neighboring Iran involving ballistic missiles.

Military officials on the base said they saw this as the worst-case scenario, sending the facility into lockdown and forcing a swiftly planned dispersal of troops among cramped shelters, watchtowers, and bunkers built deep underground by the army of former Iraqi president Saddam Hussein, Garland said.

More than two hours passed, leaving military officials to wonder whether it had been a false alarm.

The office of Iraqi Prime Minister Adel Abdul Mahdi later said it notified Iraq's Joint Operations Command, which shares an operations room with the U.S.-led coalition, about 30 minutes before the actual attack began.

Then, minutes before 1:30 a.m. Wednesday, a new warning came. Radar indicated that a ballistic missile strike was imminent. Loudspeakers blared warnings, and the base braced for impact.

"Right before the first wave began, it was quiet, but then over the radio we heard a crackle and 'incoming, incoming,' " said 1st Lt. Charles Duncan, 25, standing amid the charred and twisted remnants of another soldier's living space. "In those seconds, we just waited."

Amid concerns about a potential ground incursion, some troops stayed out all night, manning the perimeter and checking for casualties as the attack continued, officials said.

From a watchtower, Cpl. Joel Valdivia, 30, said he could see the first four missiles coming. Minutes after he sent warning to a rapid-response team, he said, the air filled with light, and then the structure began to shake.

Down below, several dozen troops were in armored vehicles and on foot. Staff Sgt. Armando Martinez, 35, whose job had been to assess any casualties, said he heard Valdivia's radio call and dived behind a wall for cover.

Emerging when the first volley appeared to be over, he was caught on the open ground when his radio went out and a second wave hit. He saw nowhere to run and so went down on one knee as a young soldier helped him try to restore the connection.

Inside some bunkers, the impact of the missiles sent door frames deeper into the ground, soldiers said. Prefabricated buildings were twisted into unrecognizable carcasses of metal.

The all-clear was sounded shortly before the sun rose, with troops emerging wary, relieved and shot through with adrenaline. It was a clear morning with the sky burning orange, and the sight, several service members said, was "beautiful."

In an address to the nation later that day, President Trump said that no American or Iraqi personnel had been killed, and that Iran "appeared to be standing down" after firing 16 ballistic missiles at bases hosting U.S. forces, including 11 that landed at al-Asad.

On Monday, troops were still wearing body armor while walking through open spaces on the base. In the canteen, wooden chairs were upturned on the tables, as personnel were required to grab their food and then leave.

Walking toward the exit doors, a young servicewoman nudged her friend's arm and laughed. "Not normal here these days, is it?" she quipped.

Mustafa Salim contributed to this report.