Iran
An Iranian woman holds a poster displaying slain militant leaders including Hamas's Ismail Haniyeh during his funeral procession in Tehran AFP

Iran and armed groups backed by it are preparing coordinated action meant to deter Israel but avert all-out war, sources and analysts said, after the killings of top Hamas and Hezbollah figures.

On Wednesday, Iranian officials met in Tehran with representatives of the so-called "Axis of Resistance" -- a loose alliance of Tehran-backed groups hostile to Israel -- to discuss retaliation for the deaths of Hamas's leader and Hezbollah's top military commander, said a source close to Lebanese group.

"Two scenarios were discussed: a simultaneous response from Iran and its allies or a staggered response from each party," the source who had been briefed on the meeting told AFP, requesting anonymity to discuss sensitive matters.

Iran's supreme leader Ayatollah Ali Khamenei threatened a "harsh punishment" for the killing of Hamas leader Ismail Haniyeh in Tehran, which the group blamed on Israel, also vowing revenge.

Hezbollah leader Hassan Nasrallah warned Thursday his group was bound to respond to Israel's killing of top military commander Fuad Shukr, saying in a speech broadcast at the funeral that his death and that of Haniyeh "crossed" red lines.

Israel said it "eliminated" Shukr Tuesday in a strike on southern Beirut, describing him as Nasrallah's "right-hand man". He led operations in south Lebanon, where the group has exchanged near-daily fire with Israel since the Gaza war erupted.

"There is a very strong likelihood that the response will be coordinated... among other resistance actors," said Amal Saad, a Hezbollah researcher and lecturer at Britain's Cardiff University.

"It's going to greatly deepen the tactical coordination between Iran" and the groups it supports across the region, she said, naming Lebanon's Hezbollah, Palestinian movements Hamas and Islamic Jihad, Yemen's Huthi rebels and Iraq's Hashed al-Shaabi force.

A leader of the Islamic Resistance of Iraq, a loose alliance of pro-Iran groups, told AFP that "Iran will lead the first response with the participation of Iraqi, Yemeni and Syrian factions, striking military targets, followed by a second response from Hezbollah".

The Iraqi alliance has claimed attacks on US troops, most recently over the Gaza war, before suspending them in late January.

It has also claimed to have targeted Israel with drones and rockets.

The source, who requested anonymity to discuss sensitive matters, said Hezbollah may target civilians to avenge the killing of three women and two children in the strike that killed Shukr in Beirut.

Iran and its allies are widely expected to respond militarily to the killings blamed on Israel, which has claimed responsibility only for Shukr's death, though experts say the retaliation would be measured to avoid a wider conflagration.

"Iran and Hezbollah will not want to play into (Israeli Prime Minister Benjamin) Netanyahu's hands and give him the bait or ammunition he needs to drag the US into a war," Saad said.

"They will more than likely try to avert a war while also strongly deterring Israel from continuing with this new policy, this targeted shock and awe."

The White House said the two killings hours apart "don't help" regional tensions, though National Security Council spokesman John Kirby said that Washington saw "no signs that an escalation is imminent".

Iranian analyst Ahmad Zeidabadi, who specialises in international relations, said "a stronger response is expected" from Tehran than during its last direct face-off with Israel in April.

Iran on April 13 made its first ever direct attack on Israeli soil, firing a barrage of drones and missiles after a strike blamed on Israel killed Revolutionary Guards at Tehran's consulate in Damascus.

The United States was in touch with Iran at the time, sending "a series of direct communications through the Swiss channel," a senior administration official had told AFP.

Zeidabadi said that "a repeat of the previous operation wouldn't make much sense, because the missiles and drones did not hit sensitive areas or have a deterrent effect."

But he ruled out a "generalised, all-out and out-of-control war".

According to Middle East analyst Rodger Shanahan, "regime survival" is a top priority for Tehran, "the same as Hezbollah".

"They will put a lot of pressure on the Israelis on behalf of the Palestinians, but they are not going to risk an existential threat against them," he told AFP.