Iran has launched a series of missile attacks on US facilities in Iraq, days after the US assassinated top Iranian commander Qassem Soleimani.

Iranian state television said in the early hours of Wednesday that the Islamic Revolutionary Guard Corps (IRGC) had attacked Ain al-Assad military base, where US troops are stationed. A second facility near Erbil airport was also hit.

More:

The Iraqi military said in a statement that 22 missiles were launched on the two sites between 1:45am and 2:15am. Two of the 17 missiles targeting Ain al-Assad base did not go off, the military said, while the five missiles on Erbil all targeted coalition headquarters.

In a statement on Twitter, Iranian Foreign Minister Mohammad Javad Zarif said Iran had taken and concluded "proportionate measures in self-defence" under Article 51 of the UN Charter.

"We do not seek escalation or war, but will defend ourselves against any aggression," he said.

In Washington, US President Donald Trump said in a tweet late on Tuesday that an assessment of casualties and damage from the strikes was under way.

"All is well!" Trump said in the Twitter post, adding that he would make a statement on Wednesday morning.

All is well! Missiles launched from Iran at two military bases located in Iraq. Assessment of casualties & damages taking place now. So far, so good! We have the most powerful and well equipped military anywhere in the world, by far! I will be making a statement tomorrow morning. — Donald J. Trump (@realDonaldTrump) January 8, 2020

Iranian state television claimed at least 80 "American terrorists" were killed in attacks involving 15 missiles, adding that none of the missiles was intercepted. The claim could not be independently verified and the state television did not provide evidence of how it obtained that information.

Citing a senior IRGC source, the state television also said Iran had 100 other targets in the region in its sights if Washington took any retaliatory measures. It also said US helicopters and military equipment were "severely damaged".

There was no immediate comment by US officials. Earlier, a US official speaking on condition of anonymity told The Associated Press news agency there were "few, if any" casualties.

Meanwhile, the Danish armed forces said in a Twitter post no Danish soldiers were wounded or killed in the missile strike on the Ain al-Assad airbase. Denmark has about 130 soldiers at the base as part of the international coalition fighting the ISIL (ISIS) armed group.

In a statement soon after the launch of the missiles, Iran warned US allies in the region - including Israel - that they too would be attacked if they allowed their countries to be used for attacking Iran.

Iranian television reported a senior official in the Iranian supreme leader's office saying the missile attacks were the "weakest" of several retaliation scenarios.

Iran attacked Ain al-Assad airbase in the western Anbar desert of Iraq in the early hours of Wednesday morning. US forces are stationed in the sprawling complex [File: Nasser Nasser/AP Photo]

Meanwhile, the Pentagon confirmed more than a dozen missiles had been launched against US and coalition forces in Iraq, adding that the missiles had come from Iran.

"We are working on initial battle damage assessments," Pentagon spokesman Jonathan Hoffman said in a statement. "We will all take all necessary measures to protect and defend US personnel, partners and allies in the region."

US Secretary of State Mike Pompeo and Secretary of Defense Mark Esper arrived at the White House late on Tuesday and an official said Trump had been briefed on the attacks and was monitoring the situation closely.

Hours earlier, Esper said the US should anticipate a response from Iran for Friday's killing of Soleimani, the head of the elite Quds Force who was assassinated in a US drone strike near Baghdad's international airport, alongside Iraqi paramilitary commander Abu Mahdi al-Muhandis and several others.

"I think we should expect that they will retaliate in some way, shape or form," he told a news briefing at the Pentagon, adding that such retaliation could be through Iran-backed proxy groups outside of Iran or "by their own hand".

"We're prepared for any contingency. And then we will respond appropriately to whatever they do."

House of Representatives Speaker Nancy Pelosi, a Democrat, earlier warned the US and the world could not afford to go to war.

Ismael Alsodani, a retired Brigadier General and former Iraqi defence attache to the US told Al Jazeera Iran's response was calibrated to reflect the seriousness of the Soleimani attack.

"Killing Soleimani was an insult from the Americans to the Iranians," Alsodani said. "They are compelled to retaliate in a way where the target will be the same size and scale of killing Soleimani. I don't think this will be the only retaliation."

Prompted by the strong public backlash for Soleimani's killing on Iraqi soil, legislators in Iraq voted on Sunday to demand the removal of all foreign forces from the country.

Closely monitoring the situation following bombings targeting U.S. troops in Iraq. We must ensure the safety of our servicemembers, including ending needless provocations from the Administration and demanding that Iran cease its violence. America & world cannot afford war. — Nancy Pelosi (@SpeakerPelosi) January 8, 2020

More than 5,000 US troops remain in the country along with other foreign forces as part of a coalition that has trained and supported Iraqi security forces against the threat from ISIL.

"The worst expectation that Iraq had, that it will again become a theatre of confrontation between world powers seems to be coming true again tonight, as Iraq was the place where the US chose to take out Soleimani and Iraq again is the place where the Iranians chose to attack US forces," Al Jazeera's Osama Bin Javaid said from Baghdad.