Donald Trump's tweet hints that US is unfazed by Iran attack on Iraq bases used by US forces.

Highlights "So far, so good": Trump after Iran fires missiles at Iraq

Two bases used by US forces in Iraq targeted

"Assessment of casualties and damages taking place now": Trump

US President Donald Trump tweeted "all is well" hours after Iran launched over a dozen ballistic missiles at two military bases used by US forces in Iraq.

"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," President Trump tweeted.

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

Iran said it launched the missile attack to retaliate for last week's killing of its top military commander Qassem Soleimani in a drone strike, according to a statement on state TV. The statement told the US to withdraw its troops from the region to prevent more deaths, state TV said. The Pentagon did not provide reports of casualties in the attack.

"We are working on initial battle damage assessments," Pentagon spokesman Jonathan Hoffman said in a statement, adding the bases targeted were al-Asad air base and another in Erbil, Iraq.

President Trump, who visited the al-Asad air base in December 2018, has been briefed on reports of the attack and was monitoring the situation, White House spokeswoman Stephanie Grisham said. US Secretary of State Mike Pompeo and Defence Secretary Mark Esper arrived at the White House following news of the attack. It was unclear what response, if any, the United States was planning, news agency Reuters reported.

Hours earlier on Tuesday, Mr Esper said the US should anticipate retaliation from Iran over Friday's killing in Iraq of Soleimani, commander of the elite Quds Force. "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."

Stock markets in Asia fell sharply on news of the rocket attack, while investor safe havens including the Japanese yen and gold shot higher. US crude prices surged almost 5 per cent on worries any conflict could cut oil supplies.

The US Federal Aviation Administration said it would prohibit US civil aviation operators from operating in the airspace over Iraq, Iran, the Gulf and the Gulf of Oman. Singapore Airlines had already diverted all flight routes from Iranian airspace.

With inputs from Reuters