The U.S. received advance warning of Iranian missiles that hit two Iraqi military bases hosting American forces, according to a defense official Wednesday. 

"U.S. early warning systems detected the incoming ballistic missiles well in advance, providing U.S. and coalition forces adequate time to take appropriate force protection measures," the official told Anadolu Agency on condition of anonymity.

The U.S. sustained no casualties when Iran's Islamic Revolutionary Guards Corps launched more than a dozen ballistic missiles in retaliation for the American assassination of Gen. Qasem Soleimani, the corps' former Quds Force commander.

The CNN network reported that Iran warned Iraqi officials that the attack would begin. That officials reportedly informed U.S. troops about the Iranian attacks.

Soleimani was killed by a U.S. airstrike Friday near Baghdad International Airport.

The strike followed a series of tit-for-tat recriminations between the U.S. and Iran-backed forces that began with the killing of an American contractor at a U.S. base in Iraq late last month.

The U.S. retaliated with airstrikes on the Iran-backed militia it says is responsible for conducting the attack, killing dozens.

The U.S. Embassy in Baghdad was then attacked last Tuesday by a group of enraged militiamen and demonstrators.

U.S. officials have placed blame for the attacks on the U.S. embassy and base squarely on Soleimani's shoulders, claiming if the airstrike that killed him was not carried out hundreds more American lives would have been lost.