Israel and Iran traded threats after Tehran's first ever direct attack on its arch foe sharply heightened Middle East tensions and as the Gaza war ground on with no truce in sight.

Israel's military chief Lieutenant General Herzi Halevi on Monday vowed "a response" after Iran and its allies launched a barrage of over 300 missiles, drones and rockets at Israel at the weekend.

Iran said its large-scale attack was an act of self-defence following a deadly Israeli air strike on its consulate in Syria, and that it would consider the matter "concluded" unless Israel retaliated.

However, Iran's President Ebrahim Raisi also warned that "the slightest action against Iran's interests will definitely be met with a severe, extensive and painful response".

US President Joe Biden stressed on Monday that "the United States is committed to Israel's security" but also that he wants to prevent the conflict from spreading.

Washington, Israel's top ally and arms supplier, has made clear it will not join Israel in any attack on their common adversary Iran, a senior US official said.

World leaders have urged restraint since Iran's attack on Israel, which has sparked a flurry of crisis diplomacy and sent up oil prices while depressing stock markets.

In Gaza, where the war raged on, Biden said, "we're committed to a ceasefire that will bring the hostages home and prevent the conflict from spreading beyond what it already has".

Israel kept its bombing of targets in Gaza, the coastal territory that has been largely devastated by more than six months of war and a siege on its 2.4 million people.

- Israel weighs options -

Since the Iranian attack, Israeli Prime Minister Benjamin Netanyahu has twice convened his war cabinet, set up after Hamas launched the October 7 attack that sparked the bloodiest ever Gaza war.

Israel was weighing its options after the Iranian drone and missile onslaught, which caused little damage as Israeli defences intercepted most projectiles, helped by US, British and French forces and regional allies.

It remained unclear when Israel might strike and whether it would target Iran directly or attack its interests or allies abroad, including in Lebanon, Syria, Iraq and Yemen.

In Iran, nuclear facilities were temporarily closed over "security considerations", said International Atomic Energy Agency chief Rafael Grossi.

Netanyahu said in a message on X that "the international community must continue to stand united in resisting this Iranian aggression, which threatens world peace".

Foreign Minister Israel Katz said he had launched a diplomatic offensive against Iran by writing to 32 governments and speaking with dozens of politicians.

His message was a call "for sanctions to be imposed on the Iranian missile project and that the Islamic Revolutionary Guard Corps be declared a terrorist organisation", he wrote on X.

Iran, a declared enemy of the United States and Israel, has stressed it had no advance knowledge of the October 7 attack but has praised its ally Hamas for it.

Iran-backed armed groups across the region have carried out attacks during the six-month-old war.

Lebanon's Hezbollah movement has traded deadly cross-border fire with Israel, Yemen's Huthis have targeted Red Sea shipping, and groups in Iraq and Syria have fired at US bases.

Israel has launched multiple deadly raids on Iranian-linked targets in the region, usually without acknowledging them.

On Monday, Israel made its first official comment on the deadly strike on the Iranian consulate in Damascus that prompted Tehran's weekend attack.

The strike on April 1 levelled the five-storey building and killed seven Iranian Revolutionary Guards, two of them generals.

"These were people who engaged in terrorism against the State of Israel," said Israeli military spokesman Daniel Hagari. "There was not a single diplomat there as far as I know."

- 'Catastrophic hunger' -

Israel's military has vowed the Iran tensions will not distract it from the ongoing war in Gaza where it aims to destroy Hamas and bring home the hostages.

Truce talks involving US, Qatari and Egyptian mediators have so far failed to bring a deal, and Israel has rejected a Hamas demand that it withdraw its forces from Gaza.

The war started after Hamas launched an attack on October 7 that resulted in the deaths of 1,170 people in Israel, mostly civilians, according to Israeli figures.

The militants also took about 250 hostages, of whom Israel estimates 129 remain in Gaza, including 34 who are presumed dead.

Israel's retaliatory offensive has killed at least 33,843 people in Gaza, mostly women and children, according to the health ministry in the Hamas-run territory.

Fifteen people, including children, were killed in the southern city of Khan Yunis on Tuesday morning, it said.

The war and siege have triggered a dire humanitarian crisis in Gaza, with desperate shortages of food, water, medicines and fuel, alleviated only by sporadic aid deliveries.

Israel has faced growing global opposition to the relentless war that has reduced vast areas of Gaza to a wasteland of gutted buildings, bomb craters and mountains of rubble.

Netanyahu has insisted, despite US objections, that the army will invade Gaza's far-southern city of Rafah where some 1.5 million people live in shelters.

The army said Tuesday that in ongoing combat, its troops operated in central Gaza and tanks killed "a number of terrorists identified advancing towards them".

Fighter jets destroyed "terror tunnels and military compounds where armed Hamas terrorists were located", the army said.

The United Nations has warned that the Gaza war and siege have caused "the highest levels of catastrophic hunger in the world".