Iraq's caretaker Prime Minister Adel Abdul Mahdi was alerted by Iran that its response to the US assassination of its top military general was either imminent or under way, according to his spokesman.

Iran on Wednesday fired missiles at Iraqi bases housing US and other foreign troops amid escalating tensions between Washington and Tehran following the US assassination of Iranian military commander Qassem Soleimani in Iraq last week.

More:

"Shortly after midnight on Wednesday we received a verbal message from the Islamic Republic of Iran that the Iranian response to the assassination of the martyr Qassem Soleimani had started or was about to start," Abdul Mahdi's spokesman said in a statement.

Tehran told Abdul Mahdi it would only target locations where US forces were present but did not specify the locations, the spokesman added.

Abdul Mahdi also received a call from the United States while missiles were falling on the US wing of the Ain al-Asad base in Anbar province and a facility in Erbil, the spokesman said.

There have been no reports of casualties from either the Iraqi military or the US-led coalition, he said.

22 missiles

Earlier on Wednesday, the Iraqi military said in a statement that a total of 22 missiles were fired.

"Between 1:45am and 2:15am [22:45 GMT and 23:15 GM] Iraq was hit by 22 missiles, 17 on the Ain al-Asad airbase and ... five on the city of Erbil," the Iraqi military said.

"There were no victims among the Iraqi forces," it added, without mentioning whether or not there were casualties among foreign troops.

Following the strikes, US President Donald Trump said on Twitter that an "assessment of casualties & damages taking place now".

"So far, so good!" he wrote.

More than 5,000 US troops remain in Iraq along with other foreign forces as part of a coalition that has trained and backed up Iraqi security forces in the fight against the Islamic State of Iraq and the Levant (ISIL or ISIS) armed group.

200108022159468

Some 115 German soldiers are stationed in Erbil and all were fine, a spokesman for Bundeswehr operations said.

Denmark, which has about 130 soldiers in Iraq, said no Danish soldiers were wounded or killed in the attack on Ain al-Asad, the largest airbase where US-led coalition troops are based.

It was the first time Iran directly hit a US installation with ballistic missiles.

Soleimani, who headed Iran's Quds Force, the overseas arm of the elite Revolutionary Guards Corps, was buried after the missile attacks, Iranian state television said.

"His revenge was taken and now he can rest in peace," it said.

The missiles were launched at the same time of the day that Soleimani was killed on Friday near the international airport in Iraq's capital, Baghdad. He was buried in the "martyrs' section" of a cemetery in his hometown of Kerman.