Iran will help any nation or group that confronts the "cancer" Israel, the Islamic Republic's Supreme Leader Ayatollah Ali Khamenei has said.
Israel was a tumour that should be cut, he said.
He also said that the country would continue its controversial nuclear programme, and warned that any military strike by the US would only make Iran stronger.
His comments to worshippers at Friday prayers in Tehran were broadcast on state TV.
Iranian officials have reacted defiantly to indications by the US and Israel that they might take military action against Iranian nuclear facilities.
But any statement by Iran's Supreme Leader, who has final say on all matters of state, makes it all the more unlikely that Tehran will switch tack.
Khamenei also said that Iran had assisted militant groups like the Lebanese Hezbollah and the Palestinian Hamas - a well-known policy, but one that Iranian leaders rarely state explicitly.
"We have intervened in anti-Israel matters, and it brought victory in the 33-day war by Hezbollah against Israel in 2006, and in the 22-day war," between Hamas and Israel in the Gaza Strip.
Israel's large-scale military incursion against Hamas in 2008-2009 in Gaza ended in a ceasefire, with Israel claiming to have inflicted heavy damage on the militant organisation.
The war in Lebanon ended with a UN-brokered truce that sent thousands of Lebanese troops and international peacekeepers into southern Lebanon to prevent another outbreak.
"From now on, in any place, if any nation or any group confronts the Zionist regime, we will endorse and we will help. We have no fear expressing this," said Khamenei.
He said Israel is a "cancerous tumour that should be cut and will be cut".
The remarks are a rare direct acknowledgement by an Iranian leader of Tehran's intervention against Israel in armed conflicts. Iran has usually said in the past that it offers political support to Hezbollah and the Palestinian groups.
Khamenei also said that the US will suffer defeat and lose standing in the region, if Washington decides to use military force to stop the country's nuclear programme.
"Iran will not withdraw. Then what happens?" asked Khamenei. "In conclusion, the West's hegemony and threats will be discredited" in the Middle East. "The hegemony of Iran will be promoted. In fact, this will be in our service."
Both US and Israel have not ruled out a military option against Iran's nuclear facilities, which the West suspects are aimed at developing weapons technology.
Iran says its nuclear activities are geared toward peaceful purposes such as power generation and medical isotopes.
Another potential military flashpoint is the Strait of Hormuz at the mouth of the Persian Gulf. Iran has threatened to close the strait in response to US and EU sanctions targeting the country's oil exports.