Boasting that Hezbollah's 40-mile range missiles "turned Israel into a country of ghosts," Khatami declared that Israel would face dire consequences if it "makes an iota of aggression against Iran."
"They must fear the day (Iran's) 1,250-mile range missiles land in the heart of Tel Aviv," he said.
Khatami is a Friday prayer leader in Tehran and a member of the Assembly of Experts, a clerical panel that has the power to choose or dismiss Iran's top leader, but he is not considered a government official.
Tehran perceives international criticism of its nuclear program as carrying a potential threat of military action. The U.N. Security Council has given Iran until the end of August to halt its uranium enrichment activities, or face potential sanctions.
Israel has remained in the background as the United States and several Western allies have stepped up claims that Iran seeks to develop nuclear arms — an allegation Iran denies. But Israel has made no secret that it takes a dim view of Tehran's nuclear aspirations.
Iranian President Mahmoud Ahmadinejad has repeatedly called for Israel to be destroyed.
Many in the U.S., Europe, the Arab world and Israel accuse Iran of having fueled the warfare in Lebanon through its close ally, Hezbollah, in a bid to show its regional strength. A U.N.-imposed cease-fire took effect Monday, ending more than a month of fighting between Hezbollah and Israel.
Iran, like Hezbollah, viewed the end of fighting as a victory over Israel.
Iran's parliament speaker Gholam Ali Haddad Adel told a session of parliament Tuesday that "Hezbollah's victory broke the image of Israel's non-defeatability."
Khatami's comment about Iran's long-range capabilities appeared to refer to an upgraded version of its Shahab-3 missile, which is capable of carrying a nuclear warhead and reaching Israel and U.S. bases in the Middle East.
Iran's military test-fired a series of missiles during large-scale war games in the Persian Gulf in March and April including a missile not detectable by radar that can use multiple warheads to hit several targets simultaneously, a development that raised concerns in the United States and Israel.
After decades of relying on foreign weapons purchases, Iran's military has been working to boost its domestic production of armaments. Since 1992, Iran has produced its own tanks, armored personnel carriers, missiles and a fighter plane. It announced in early 2005 that it had begun production of torpedoes.