The Iraqi caretaker Prime Minister Adel Abdul Mahdi on Wednesday called on the United States and Iran to exercise self-restraint and respect the Iraqi state after the Iranian missile attack on military bases housing U.S. forces in western and northern the country.

Abdul Mahdi said that Iraq "rejects any violation of its sovereignty and aggression on its lands, and the government continues its efforts to prevent escalation and that all parties should respect the sovereignty of Iraq and not endanger its people," a statement by his office said.

Abdul Mahdi said that Iran informed him about the attack shortly before the missile barrage and he was told that the attacks would target the U.S. forces without giving details about the locations of the bases, according to the statement.

Abdul Mahdi statement came after Iran fired ballistic missiles earlier in the day on military bases housing U.S. troops in Iraq's western province of Anbar and near the city of Erbil, the capital of the semi-autonomous region of Kurdistan.

On Friday, a U.S. drone attacked a convoy at Baghdad International Airport, killing Qassem Soleimani, commander of the Quds Force of Iran's Islamic Revolution Guards Corps, and Abu Mahdi al-Muhandis, deputy chief of Iraq's paramilitary Hashd Shaabi forces.

More than 5,000 U.S. troops have been deployed in Iraq to support the Iraqi forces in the battles against Islamic State militants, mainly providing training and advising for the Iraqi forces.