Iran will respond to any Israeli or US attack against its nuclear sites with a "proportionate" reaction, the military adviser to the country's supreme leader Ali Khamenei said on Saturday.
General Yahya Rahim Safavi, quoted by Fars news agency, said however that such an attack was unlikely.
Despite warnings from Washington and Israel that "all options are on the table" if negotiations between Iran and major powers on Tehran's controversial nuclear programme fail, conditions do not favour an assault, he said.
"They may be able start one but they can not end it and it remains in Iran's hands," the general said.
"The domestic political, economic and social conditions in America and the Zionist regime are not such as to have a new war in the region," he said.
US President Barack "Obama wants to get re-elected (in November) ... the cabinet of Mr (Israeli prime minister Benjamin) Netanyahu is a fragile one," he said.
However, in case of an attack, "we will act against their military operation smartly, proportional to any damage that they inflict on us ... meaning we will hurt them as much as they hurt us."
Rahim Safavi warned that the whole of Israel was within range of the missiles of Hezbollah, Iran's Shiite militia allies in Lebanon, and that US forces in the region were vulnerable.
"They have thousands of missiles ... (Hezbollah chief) Hassan Nasrallah is a soldier of the supreme leader ... All places in the Zionist entity are within missile range," he said.
And "the 20 American bases and more than 100,000 soldiers in the region all face Iranian danger ... The Americans know full well that all of their 60 warships in the Persian Gulf and Sea (Gulf) of Oman are vulnerable," the general added.