Iran's President Mahmoud Ahmadinejad has issued a tough warning to any country considering an attack on Iran.
Mr Ahmadinejad warned outside powers to learn from the past
He said Iran's forces were just for defence, but that anybody who attacked would experience nothing but regret.
He urged those he called the occupiers in the region - an apparent reference to the US and its allies in Iraq - to admit defeat and withdraw their troops.
Mr Ahmadinejad was speaking at a huge annual military parade marking the anniversary of the Iran-Iraq War.
On display at the parade was Iran's latest military hardware, including new long-range missiles and Saeqeh fighter jets.
According to the Associated Press news agency some of the lorries carrying Iranian missiles bore anti-US and anti-Israeli slogans.
"Those who prevented Iran, at the height of the [1980-88 Iran-Iraq] war from getting even barbed wire must see now that all the equipment on display today has been built by the mighty hands and brains of experts at Iran's armed forces," Mr Ahmadinejad said.
"Learn lessons from your past mistakes. Don't repeat your mistakes," he added.
His comments come ahead of his high-profile visit to the US next week, where he will address the UN General Assembly in New York, amid continuing tension over Iran's nuclear programme.
Mr Ahmadinejad said that neither threats nor economic sanctions would curb Iran's technological advances.
On display were Iran's new Saeqeh fighter jets
"Those [countries] who assume that decaying methods such as psychological war, political propaganda and the so-called economic sanctions would work and prevent Iran's fast drive toward progress are mistaken," the president said.
The speech comes at the end of a tense week, with the French Foreign Minister, Bernard Kouchner, warning of the danger of war with Iran over its nuclear programme.
The BBC's Jon Leyne in Tehran says Mr Ahmadinejad believes he is winning the battle for world opinion - a fight he is now taking to the UN General Assembly in New York.
The US has called for a third round of UN economic sanctions to pressure Iran into halting uranium enrichment, which it says is part of a secret plan to acquire nuclear weapons.
Iran has denied the charge, declaring that its nuclear programme is peaceful and solely aimed at producing energy.