Scott Morrison has told the chief of the Australian defence force “to take whatever actions are necessary” to protect Australian troops and diplomats in Iraq after Iran began bombing allied military bases. All defence and diplomatic staff in the country were now safe, Morrison said.

Australia’s military appears set to remain in Iraq as long as the US does, even as other allies such as Germany and Canada pull their troops out of the country.

Several sources in Iraq, including some serving as part of Australia’s Middle East operation Okra, argue Australia will hold the course as long as the US remains in the country.

Late on Wednesday, the prime minister’s office said there would be no immediate change to Australia’s military or diplomatic commitment in Iraq in the wake of the attacks.

“No further actions or decisions [are] deemed necessary at this time, however the situation continues to be closely monitored. Engagement is also continuing with coalition partners, especially the USA.”

Australia’s military commitment in the Middle East is numerically small – about 450 personnel – but as a staunch US ally, Australia’s presence in Iraq is symbolically significant, and its withdrawal would be a blow to the US-led coalition.

In the early hours of Wednesday, Tehran launched at least a dozen surface-to-air missiles at Iraq’s Al-Assad airbase, which houses US troops, in retaliation for the US assassination of Iranian General Qassem Suleimani at Baghdad airport.

There were reports “shelter in place” sirens had been heard at the Taji base, just north of Baghdad, where Australian troops are stationed. Early reports that that base had also been bombed proved incorrect.

In a statement, the prime minister said his government was closely monitoring unfolding events in Iraq, and that he was in regular contact with the defence and foreign affairs ministers, and with the chief of defence force, General Angus Campbell.

“The prime minister has directed the chief of the defence force to take whatever actions are necessary to protect and defend our ADF and diplomatic personnel and keep Australians safe.”

The national security committee of the cabinet is scheduled to meet on Thursday to discuss the Middle East situation and Australia’s role there. That committee may meet earlier if threats to Australians in the region escalate.

The Iranian government presented the targeted air-strikes as a proportionate and considered response to Soleimani’s assassination, and the strikes may ultimately prove a measure that de-escalates tension in the wake of the general’s death: allowing both the US and Iran to claim to have achieved their aims, without tensions escalating to all-out conflict.

“Iran took and concluded proportionate measures in self-defense under Article 51 of UN Charter targeting base from which cowardly armed attack against our citizens and senior officials were launched,” Iran’s foreign minister Javad Zarif said.

“We do not seek escalation or war, but will defend ourselves against any aggression.”

The Pentagon confirmed the strikes. “Iran launched more than a dozen ballistic missiles against US military and coalition forces in Iraq,” it said. “It is clear that these missiles were launched from Iran and targeted at least two Iraqi military bases hosting US military and coalition personnel at al-Assad and Irbil.”

US president Donald Trump struck an upbeat tone: “all is well,” he tweeted. He said casualty assessments were under way but “so far, so good”.

Brendan Thomas-Noone, foreign policy and defence research fellow with the United States Studies Centre, said Iran’s missile strikes appeared carefully calibrated to win domestic support, but also to allow the US to walk away from further retaliation and escalation.

“In all of the things that have happened around Iran in the last two years, everything they do is quite calculated, and I think this attack is also a calculated, proportionate response,” he said. “They had a lot of options open to them, to attack the US through proxies, or a cyber response ... but they chose to strike at US forces, in a fairly modest way, with a co-ordinated media strategy around it.

“For both the US and Iran, a large part is around trying to win the narrative: as a government if you can win the narrative with your own people, then you feel more confident about taking the off-ramp towards de-escalation.”

The Iraqi parliament on Sunday voted to expel all foreign troops from the country. The vote is not binding on Iraq’s fragile government but, combined with the escalating tensions sparked by Suleimani’s assassination, will bring immense pressure on the administration to force foreign troops out.

Longer-term, the US is likely to come under increasing pressure to withdraw its troops, and it has sent mixed signals to the Iraqi government about its intentions.

On Tuesday, Australia’s foreign affairs minister Marise Payne said Australia was urging the Iraqi government – currently led by caretaker prime minister Adil Abdul-Mahdi, who has already resigned – to allow foreign forces to remain in the country, but said: “In the meantime, the Australian government is working through the possible implications should the Iraqi government approve the resolution.”

“The safety and security of our diplomatic and Australian defence force personnel remains our paramount consideration. To that end we have drawn down to essential staff in our embassy in Baghdad and are taking all necessary measures to ensure the safety of all Australians who remain in the country.”

While the US and Australia consider whether to withdraw troops, allies have already begun leaving Baghdad. Canada has announced it would pull out some of its 500 troops, and Germany said its military presence in Iraq would be “temporarily thinned out”.

Troops and diplomats have been flown by helicopter out of the city’s fortified diplomatic district, known as the Green Zone.

Most troops are reportedly being redeployed in Kuwait. Some diplomats are being moved to other parts of Iraq, including the Taji base north of the capital.

Task Group Taji is part of Australia’s broader Operation Okra in the Middle East. The task group is a combined Australian-New Zealand military training force stationed at the Taji military complex about 30km north-west of Baghdad.

The task is a non-combat role, with Australian troops, largely drawn from the Australian Army’s 3rd Brigade, involved in training Iraqi security force troops. Taji has been running since 2015. Australia recently reduced its commitment from about 250 personnel to 120.