At least two military bases housing US troops in Iraq came under fire from at least a dozen ballistic missiles fired from Iran, the Pentagon says, in a move the Middle Eastern nation's Supreme Leader has described as a "slap on the face" against the United States.

Key points: The Pentagon said it would "take all necessary measures" to protect US troops and allies

The Pentagon said it would "take all necessary measures" to protect US troops and allies Iran's Revolutionary Guard issued a statement warning the US not to hit back

Iran's Revolutionary Guard issued a statement warning the US not to hit back Scott Morrison said all Australian troops and diplomatic staff stationed in Iraq were currently safe

"It's clear these missiles were launched from Iran and targeted at least two Iraqi military bases hosting US military & coalition personnel at Al Asad and Erbil," Pentagon press secretary Alyssa Farah tweeted.

Iranian state TV said Tehran launched "tens" of surface-to-surface missiles at the Al Asad airbase in response to America's killing of a top Iranian general.

"The fierce revenge by the Revolutionary Guards has begun," Iran's Islamic Revolutionary Guard Corps said in a statement on a Telegram channel, according to the New York Times.

People in Iran took to the streets to celebrate the missile launch. ( Reuters: Nazanin Tabatabaee/WANA )

Ayatollah Khamenei addressed his nation hours after the strike, saying: "We slapped them [Americans] on the face last night" with a missile strike "but military action is not enough."

The strike was in retaliation for the killing of Iran's top military commander in Baghdad, Qassem Soleimani, whom he called a "great, brave, warrior".

The Ayatollah also said the US is Iran's enemy and added the "corrupt presence of the US in the region should come to an end," saying it has caused war, division and destruction.

Iranian state television said at least 80 people were killed in attacks involving 15 missiles launched on US targets in Iraq, adding that none of the missiles were intercepted.

Loading

State TV, citing a senior Revolutionary Guards source, 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".

US President Donald Trump took to Twitter after the attacks to say "all is well!".

"Missiles launched from Iran at two military bases located in Iraq. Assessment of casualties & damages taking place now," he tweeted.

"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."

Loading

However, Iranian state television said that Mr Trump's tweet tried to downplay damage caused by Iran's missile attacks.

Iran's Foreign Minister Javid Zarif labelled the missile attacks on US targets as "legitimate self-defence" on Iranian state TV.

"Our action was a legitimate self-defence and the United States should avoid assessing it based on illusions," Mr Zarif said.

Loading

The country's Telecommunication Minister Mohammad-Javad Azari Jahromi tweeted: "Get the hell out of our region".

Hessameddin Ashena, an adviser to Iranian President Hassan Rouhani, said that any US retaliation to Iran's missile attacks on American targets in Iraq could lead to an all-out war in the Middle East.

"Any adverse military action by the US will be met with an all-out war across the region. The Saudis, however, could take a different path — they could have total peace!" he said on Twitter.

A senior official in Supreme Leader Ayatollah Ali Khamenei's office said Iran's response to the killing of General Soleimani so far had been the "weakest" of the Iranian revenge scenarios, state TV reported.

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Watch Duration: 1 minute 51 seconds 1 m 51 s The Pentagon has confirmed atleast a dozen ballistic missiles have been launched from inside Iran

The Revolutionary Guard issued a statement warning the US and its regional allies not to hit back.

"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," The Guard said.

It also threatened to attack US ally Israel.

Israel PM says anyone attacking Israel will be dealt 'strongest blow'

Prime Minister Benjamin Netanyahu said that Israel would hit back hard against anyone who attacked his country.

Mr Netanyahu reiterated his praise for US President Donald Trump for the killing of Iranian military commander Qassem Soleimani last week, calling it a bold move.

The Israeli leader said Soleimani had tried to destabilise the region for decades and was "planning much worse."

Without directly referencing Iran's missile strikes, Mr Netanyahu said in a speech in Jerusalem on Wednesday (local time) that Israel stood beside the US.

"Whoever tries to attack us will be dealt the strongest blow," Netanyahu said, accusing Iran of leading a campaign to "strangle and destroy" Israel.

All diggers safe, says PM

Al Asad is Iraq's second-largest airbase, housing about 1,500 US and coalition troops. ( ABC News )

Prime Minister Scott Morrison said all Australian troops and diplomatic staff stationed in Iraq were currently safe.

Speaking at a press conference on Kangaroo Island, Mr Morrison said he was in frequent contact with the Chief of the Defence Force, Angus Campbell, as well as Defence Minister Linda Reynolds and Foreign Affairs Minister Marise Payne.

He said he directed General Campbell to take whatever actions were necessary to protect and defend Australian troops and diplomatic staff in Iraq.

Earlier, Opposition Leader Anthony Albanese said Australian troops were located "just next door" to the airbases which were attacked.

US President Donald Trump visited the Al Asad airbase in Iraq on December 26, 2018. ( AP: Andrew Harnik )

About 450 Defence Force personnel are deployed to the Middle East, including around 300 in and around Baghdad and the nearby Taji base.

Late last week the Australian Government instructed non-essential staff at its Embassy in Baghdad to leave Iraq.

Al Asad airbase is in Iraq's western Anbar desert. ( AP: Nasser Nasser )

The attacks came hours after the burial of General Soleimani, which was delayed after more than 50 people were crushed to death in a stampede at his funeral.

As the head of Iran's elite Quds Force, he was one of the most powerful military figures in the region.

After the strikes, a former Iranian nuclear negotiator posted a picture of the Islamic Republic's flag on Twitter, appearing to mimic Mr Trump, who posted an American flag following the killing of General Soleimani.

Al Asad airbase — which translates to "the lion" in Arabic — is Iraq's second-largest airbase, located approximately 180 kilometres west of Baghdad.

Australian special forces captured the base from the Iraqi military in 2003. In 2011 it was handed back to the Iraqi Government.

Mr Trump made a surprise visit to the base just after Christmas in 2018.

US Vice-President Mike Pence spoke to US troops at Al Asad airbase on November 23, 2019. ( Reuters: Jonathan Ernst )

ABC/wires