Israel and Iran traded fire on Monday, seriously testing a fragile truce and threatening hopes for a deal to end the Middle East war.

Iran said it had struck Israel's Nevatim and Tel Nof air bases, as the two sides exchanged strikes in the largest flare-up since a ceasefire took effect in April.

The new attacks, including an Israeli strike on an Iranian petrochemical complex in Mahshahr, came hours after President Donald Trump called on Israel to refrain from retaliating.

"Israel had its strike and Iran had its strike. We don't need another one," Trump reportedly said.

Tehran insists any permanent deal must also halt the parallel conflict in Lebanon, where Israel is pursuing a campaign against Hezbollah. Iran's Revolutionary Guards called the attack a "warning" after Israel struck Beirut's southern suburbs.

A separate Iranian attack targeting Iraqi Kurdistan added more strain to hopes for lasting peace. The Israeli army also intercepted a missile launched from Yemen.

The sharp escalation sent crude prices surging as hopes dimmed on any reopening of the Strait of Hormuz, effectively shut by Iran.