Anyone who invades Iran would be committing suicide, Iran's supreme leader said Wednesday, following the G-8 summit's warning that the world would not tolerate an Iranian nuclear bomb.

U.S. officials have accused Iran of harboring senior Al Qaeda figures and strongly suspect it is secretly pursuing a nuclear weapons program, raising fears in Iran of punitive measures.

"U.S. threats are not new," Ayatollah Ali Khamenei (search) told tens of thousands of people who had assembled for the 14th anniversary of the death of the late Ayatollah Ruhollah Khomeini (search), the founding father of the 1979 Islamic Revolution.

Iran says its nuclear development is solely to produce electricity and that its uranium enrichment is to provide fuel for reactors, not bombs.

Leaders of the world's eight industrialized nations ended a meeting in Evian, France (search), on Monday with a statement that said: "We will not ignore the proliferation implications of Iran's advanced nuclear program."

The statement said the world could work to prevent the proliferation of nuclear weapons with tools such as inspections and "other measures ... in accordance with international law."

One U.S. official in Washington said "other measures" was code for use of force. But another U.S. official, who also spoke on condition of anonymity, played down that interpretation and Italian Prime Minister Silvio Berlusconi said Bush had told the G-8 leaders there was no foundation to speculation that the United States might attack Iran.

Khamenei did not mention the G-8 statement or Iran's nuclear program when he addressed the crowd outside the shrine to Ayatollah Khomeini in south Tehran on Wednesday.

"A military attack against Iran — a great nation with youth ready to defend their country — would be suicide for the attacker," he said.

"The Iranian nation knows, and the enemy should also know, that the authorities of the Islamic republic will not subject, or push, the country toward war with anybody. We don't welcome war," Khamenei said.

"But if somebody chooses to go to war against our country, this nation will confront it strongly and resolutely," he said.

The crowd responded with chants of "We sacrifice our blood for our leader."

Khamenei took issue with the U.S.-led occupation of Iraq, Iran's western neighbor, and U.S. allegations that Iran has been stoking anti-U.S. demonstrations among Iraq's fellow Muslim Shiites.

"[Former Iraqi President] Saddam [Hussein] was a dictator, and you are also a dictator because you don't allow the Iraqi people to decide for themselves. Don't blame Iran. If you are concerned about Iran's influence in Iraq, we are concerned about your occupation of Iraq. Who gave you the right to appoint rulers for Iraq?," he asked.

Khamenei also rejected U.S. allegations on Al Qaeda.

"They say Iran is supporting terrorists and giving shelter to them. This is a shameless lie. Iran doesn't support terrorists nor does it shelter them," he said.

Iran says its policy is to arrest Al Qaeda members and deport them to their country of origin. It has refused to reveal the names of the members it is currently holding, saying it has not yet identified them.