Iran launched missile attacks on US-led forces in Iraq in retaliation for the US drone strike that killed a top Iranian commander.
Iran fired the ballistic missiles at about 1.30am local time (2230 GMT on Tuesday), the US military said.
A second round of attacks started an hour after the first phase took place, Tehran-based Tasnim news agency reported. Iraq said 22 missiles were fired.
Iranian officials said Tehran did not want a war and its strikes "concluded" its response to Friday's killing of Qassem Soleimani, a powerful general whose burial in Iran after days of mourning was completed around the same time as Iran's missile launches. Iranian state television showed mourners celebrating the attack.
Pentagon spokesman Jonathan Hoffman said in a statement the bases targeted were al-Asad air base and another facility in Erbil, Iraq.
"As we evaluate the situation and our response, we will take all necessary measures to protect and defend US personnel, partners, and allies in the region."
Iran took & concluded proportionate measures in self-defense under Article 51 of UN Charter targeting base from which cowardly armed attack against our citizens & senior officials were launched.— Javad Zarif (@JZarif) January 8, 2020
We do not seek escalation or war, but will defend ourselves against any aggression.
US President Donald Trump said in a tweet that an assessment of casualties and damage from the strikes was under way and that he would make a statement on Wednesday morning (local time).
"All is well!" Trump, who visited one of the targeted sites in Iraq, Ain al-Asad air base, in December 2018, said on Twitter.
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
One source said early indications were of no US casualties, while other US officials declined to comment.
Iranian state television said 80 "American terrorists" had been killed and US helicopters and military equipment damaged. It did not provide evidence of how it obtained that information.
Germany, Denmark and Norway said none of their troops in Iraq were killed or injured. Iraq also said there were no casualties in its forces.
Iran, which has long said US forces should leave the Middle East, told Washington after the attacks to withdraw its troops to prevent more deaths and warned US allies including Israel not to allow attacks from their territories.
Iranian television reported an official in Supreme Leader Ali Khameni's office as saying the missile attacks were the "weakest" of several retaliation scenarios. It quoted another source saying Iran had lined up 100 other potential targets.
Iranian President Hassan Rouhani was due to speak later on Wednesday, state television reported.
More than 5000 US troops remain in the country along with other foreign forces as part of a coalition that has trained and backed up Iraqi security forces against the threat of Islamic State militants.
A NATO official told Reuters it would move some of its several hundred trainers out of Iraq. Canada said some of its 500 Iraq-based forces would be temporarily moved to Kuwait for safety reasons.
New Zealand's Minister of Foreign Affairs Winston Peters said in a statement that the missiles did not target Camp Taji, where New Zealand troops remain.
"The government has been informed that all New Zealand personnel are as safe as they can be in these developing circumstances."
Asian stock markets, which had been roiled by the attack, pared some of their losses after the tweets from Trump and Zarif. US crude prices also retreated after surging almost 5 percent on worries any conflict could cut oil supplies.
The oil minister of the United Arab Emirates, a member of the Organization of the Petroleum Exporting Countries, said the latest events should not be exaggerated. He said there was no global crude shortage and OPEC would respond to any need.
US carriers banned from airspace
The US Federal Aviation Administration said it would ban US carriers from operating in the airspace over Iraq, Iran, the Gulf and the Gulf of Oman and several Asian carriers said there were avoiding flying over the region.
In an apparently unrelated incident, a Ukrainian airliner with at least 170 people on board crashed due to technical problems soon after taking off from Tehran's Imam Khomeini airport, Iran's official news agency IRNA reported.
The Philippines has ordered its citizens to leave Iraq, the Philippine foreign ministry said, and Japanese Prime Minister Shinzo Abe had cancelled a plan to visit the Middle East this weekend, TV Asahi reported.
Democrats in the US Congress and some of the party's presidential contenders warned about the escalating conflict.
"We must ensure the safety of our service members, including ending needless provocations from the Administration and demanding that Iran cease its violence. America & world cannot afford war," US House of Representatives Speaker Nancy Pelosi said on Twitter.
Soleimani, a pivotal figure in orchestrating Iran's long-standing campaign to drive US forces out of Iraq, was also responsible for building up Tehran's network of proxy armies across the Middle East.
He was a national hero to many Iranians but viewed as a dangerous villain by Western governments opposed to Iran's arc of influence running across the Levant and into the Gulf region.
US officials have said Soleimani was killed because of solid intelligence indicating forces under his command planned attacks on US targets in the region, although they have provided no evidence.
Soleimani's burial went ahead after several hours of delay following a stampede that killed at least 56 people and injured more than 210, according to Iran's semi-official Fars news agency.
Iran TV reported Soleimani was buried after the missile attacks. "His revenge was taken and now he can rest in peace," it said.
The missiles were launched at the same time that he was killed last Friday.
Soleimani's body had been taken to holy Shi'ite Muslim cities in Iraq and Iran, as well as the Iranian capital, Tehran, before arriving to be buried in the city cemetery's "martyrs' section", according to the semi-official news agency ISNA.
In each place, huge numbers of people filled thoroughfares, chanting: "Death to America" and weeping with emotion. Supreme Leader Ayatollah Ali Khamenei wept as he led prayers in Tehran.
FAA 'closely monitoring' aviation safety in Middle East after missile attack
The US Federal Aviation Administration (FAA) said it was closely monitoring events in the Middle East and coordinating with US airlines and foreign authorities about aviation safety after the missile attack.
US carriers are banned from flying at altitudes below 26,000 feet over Iraq under FAA guidance issued in 2018 because of ongoing concerns about threats to US civil aviation throughout Iraq.
They have been banned from flying in an area of Iranian airspace above the Persian Gulf and Gulf of Oman since Iran shot down a high-altitude US drone last June. No major US airlines fly over Iran at present.
Singapore Airlines Ltd said after the attack on US bases in Iraq that all of its flights would be diverted away from Iranian airspace.
An international aviation team has been activated to support "effective coordination and communication" between airlines and countries as tensions mount in the Middle East after the death of Soleimani, global airlines body IATA said on Tuesday.
Airlines and the United Nations' aviation agency have started to monitor strategic airspace over Iran and Iraq. With some commercial carriers still serving those countries and others flying over their airspace, the International Air Transport Association also issued a statement reminding countries of their obligation to communicate potential risks to civil aviation.
"It is critical that states live up to this obligation as tensions in the Middle East rise," the group said.
On Monday, Germany published a new warning for Iraq, indicating areas of concern for overflying traffic, according to a report published by the site OPSGROUP.
The coordination team operated by IATA and the International Civil Aviation Organization (ICAO) was activated as a "standard precautionary measure," in the event that contingency measures are required by airlines, IATA said in a statement to Reuters.
The team brings together airlines, regulators and air navigation service providers to ensure any potential risks to aviation are shared quickly, an industry source familiar with the group said.
"Everyone's urging restraint," said the source, who spoke on condition of anonymity because of the sensitivity of the matter.
Airspace controlled by Iran and Iraq are seen as strategic for commercial aviation in the Middle East. If there were the need to shut down the airspace, carriers would have to be rerouted which would lead to greater congestion and fuel costs, said the source.