Iran's supreme leader has warned the United States that any attack against his country would be "suicide for the aggressor".
Ayatollah Khamenei and his clique of clerics dominate Iran
"US threats are not new," Ayatollah Ali Khamenei told tens of thousands of people in Tehran. They were marking the 14th anniversary of the death of Iran's revolutionary leader Ayatollah Ruhollah Khomeini.
"A military attack against Iran - a great nation with youth ready to defend their country - would be suicide for the aggressor," he said.
The US administration - which accuses Iran of harbouring terrorists, interfering in Iraq and seeking to develop nuclear weapons - has dismissed as "idle speculation" reports that Washington is considering attacking Iran.
Iran - alongside North Korea - was specifically warned by the leaders of the world's richest nations at their summit in France earlier this week to comply with international nuclear safeguards.
In their global propaganda they're attacking Iran and
saying Iran is supporting terrorists. This is a shameless lie
Iran denies all the allegations, saying that its nuclear programme is strictly for peaceful purposes.
Russia is helping to build Iran's first nuclear reactor - at Bushehr in the south of the country.
Iran has invited the United States to join the project - an offer already rejected by the Americans.
"The Iranian people know that the Islamic Republic's leaders will not lead the country to war with anybody," Ayatollah Khamenei told the crowd outside the mausoleum to Ayatollah Khomeini, the founding father of the 1979 Islamic Revolution.
Huge crowds of Iranians gathered to mourn Ayatollah Khomeini
"We would not welcome war, but the people and their leaders will defend the country from any aggression with power and determination," Ayatollah Khamenei said.
He also dismissed as a "shameless lie" US claims that Tehran was supporting al-Qaeda members and interfering in neighbouring Iraq.
"In their global propaganda they're attacking Iran and saying Iran is supporting terrorists," he said.
"They say they are worried about Iran's interference in Iraq. Well we are worried about your presence in Iraq."
Ayatollah Khamenei's speech was repeatedly interrupted by the crowd, who chanted "Death to America!" and "We sacrifice our blood for our leader!"
Despite mounting pressure over its nuclear programme, Iran has so far refused to sign an additional protocol to the Nuclear Non-proliferation Treaty (NPT).
That would permit tougher international inspections, giving the Iranians a chance to prove they are not trying to produce nuclear weapons.
Earlier this week, Iran said it would not sign any new protocols until international sanctions were dropped and Iran was given the technology for peaceful atomic energy. It says it should be allowed such technology under the NPT, which it has already signed.
The BBC's Jim Muir in Tehran says pressure on the nuclear issue may increase sharply if the International Atomic Energy Agency (IAEA) finds Iran to be in breach of its obligations.
The IAEA is due to present its report on inspections in Iran in 12 days time.