The Iraqi Prime Minister revealed today that Iran gave him a tip-off about last night's missile strikes, giving time for troops to scramble to bunkers.

US troops also got a heads up warning from America's advanced detection system.

Iran fired more than a dozen missiles at the Ain al-Asad airbase in western Iraq and the Erbil base in Iraqi Kurdistan in the early hours of Wednesday local time.

PM Adel Abdul Mahdi received a call from Tehran warning him an attack was imminent in retaliation for the US killing of its highest ranking general, his spokesman said.

CNN, citing an Arab diplomatic source, said that Iraqi officials then passed the information on to US troops before the attack began.

US troops were also alerted to the danger using an 'early warning system,' an official revealed.

This is believed to refer to the little-known National Security Agency base at Fort Meade, Maryland, which gathers real-time intelligence on missile launches.

The Iraqi PM said he was told by Iran it would only target locations where U.S. forces were present but did not specify the locations, his spokesman said.

However, as the missiles were raining down on the US bases, he also received a call from Washington to tell him what they knew of the assault.

Iran targeted the U.S. late Tuesday by firing more than a dozen ballistic missiles at two military bases in Iraq housing American troops

The NSA's base at Fort Meade, the Defense Special Missile and Aerospace Center (DEFSMAC) uses a range of satellites, radar and heat detection to gather intelligence on missile launches as they happen.

'The early warning system worked,' an official told USA Today.

So far no casualties have been reported, the Pentagon issued a statement last night saying, 'We are working on initial battle damage assessments.'

Those in harm's way at the Ain al-Asad airbase are understood to have taken cover in bunkers throughout the bombardment, putting in place well-drilled practices.

What do we know about DEFSMAC: The Defense Special Missile and Astronautics Center has served the Pentagon since 1964, according to a declassified NSA report. The Department of Defense said in 2012: 'DEFSMAC is located at NSA headquarters at Fort George G. Meade, Maryland, and has been in operation 24 hours a day, 365 days a year, for almost 50 years.' It outlines how in the 1970s the emphasis was on Soviet missiles and space launches, but as other nations gathered such arsenals from Africa to China, it became a global detection system. 'The Gulf War in 1991 gave DEFSMAC a chance to shine,' the report says. Advertisement

Buildings were still being searched to find possible casualties, an official said. Iraqi officials confirmed there had not been any casualties among their forces.

President Donald Trump tweeted that 'all is well' and 'so far so good' as the damage and casualties continued to be assessed.

The Iraqi military said 22 missiles were fired in total - 17 at the Asad base, two of which failed to explode, and five more that struck Erbil International Airport.

US officials put the total slightly lower at 15 - ten of which hit Asad, one which hit Erbil, four which failed in flight.

The Fort Meade base evolved during the Cold War and detected Iraq's launch of Scud missiles during the first Gulf War, NBC reported.

The 22 missiles fired last night are believed to be a combination of the Qiam-1s or Fateh-110s.

The majority of those used are believed to be the Fateh-110, which can travel 180 miles or 300km and have a payload of around 500lb.

Reports also suggest the Qiam-1 was also used, a short range ballistic missile produced by Iran which can travel 500 miles and carry 750lb warheads.

The Fateh-110 is an Iranian-designed, short-range, surface-to-surface ballistic missile that can be launched from any location.

The Ain al-Asad airbase in western Iraq and the Erbil base in Iraqi Kurdistan were both struck by the missiles on Tuesday at about 5.30pm (EST)

While the Qiam-1 was specifically built to target U.S. bases in the Middle East, which have 'encircled Iran', according to Iranian sources.

When it was launched the Fateh-110 was described by Iranian defence minister Brigadier General Amir Hatami as '100-percent domestically made - agile, stealth, tactical (and) precision-guided'.

Both missiles are reported to have been fired from Tabriz and Kermanshah provinces in Iran.

Ain al-Asad air base was first used by American forces after the 2003 U.S.-led invasion that toppled dictator Saddam Hussein, and later saw American troops stationed there amid the fight against the Islamic State group in Iraq and Syria.

It houses about 1,500 U.S. and coalition forces.

The al-Asad base for American and coalition troops (pictured above in December) was struck by missiles 'clearly launched from Iran', U.S. officials say

The Erbil base in Iraqi Kurdistan, which provides facilities and services to at least hundreds of coalition personnel and CIA operatives, was also hit in the missile attack

About 70 Norwegian troops also were on the air base but no injuries were reported, Brynjar Stordal, a spokesperson for the Norwegian Armed Forces said.

The rockets used in the attack, according to Iranian TV, were Fatteh-110 ballistic missiles, which have a range of 186 miles or 300km.

The Pentagon had earlier said the missiles were 'clearly launched from Iran' to target U.S. military and coalition forces.

Iran's Revolutionary Guards admitted to firing the rockets in retaliation for last week's killing of Iranian general Qassem Soleimani.

Iran's foreign minister said: 'We do not seek escalation or war, but will defend ourselves against any agression'

President Donald Trump tweeted that 'all is well' and 'so far so good' as the damage and casualties continued to be assessed

They reported the operation's name was 'Martyr Soleimani' and it took place just hours after the slain general's funeral.

Iran's foreign minister Javad Zarif called the attacks 'self-defense' but said they did 'not seek escalation' but would defend itself against further aggression.

The Islamic Revolutionary Guard Corps, a branch of the Iranian Armed Forces, reportedly said Iran's supreme leader Ayatollah Khamenei was personally in the control center coordinating the attacks.

In the immediate aftermath, they warned U.S. allies in the Middle East that they would face retaliation if America strikes back against any Iranian targets from their bases.

President Trump and First Lady Melania visited the al-Asad airbase in western Iraq in December 2018. The airbase was targeted by Iran on Tuesday in a missile attack

'We are warning all American allies, who gave their bases to its terrorist army, that any territory that is the starting point of aggressive acts against Iran will be targeted,' they said. It also threatened Israel.

South Carolina Senator Lindsey Graham said after the attacks that the missile strikes were an 'act of war' and said Trump had all the power he needed to act.

'This is an act of war by any reasonable definition,' Graham told Fox News' Sean Hannity.

'The President has all the authority he needs under Article II to respond.'

House Speaker Nancy Pelosi tweeted that the U.S., as well as the rest of the world, 'cannot afford war'.

'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,' she tweeted.

The missiles strikes prompted the U.S. Federal Aviation Administration to ban U.S. carriers from operating in the airspace over Iraq, Iran, the Gulf of Oman and the waters between Iran and Saudi Arabia.

That decision came just hours before a Ukrainian passenger plane bound for Kiev fell from the sky just outside of Tehran - sparking speculation it was shot down, killing all 170 passengers on board.