Iranian President Mohammad Khatami has described as "madness" the possibility of an American strike on his country.
President Khatami made his remarks during a visit to Uganda
Mr Khatami said while Iran was maintaining "full vigilance", he considered the probability of a US attack to be "very negligible".
He said Iran had "plans" to defend itself in the event of the US resorting to military aggression.
Tension has been mounting between the two nations as the US suspects Iran of developing a nuclear weapons programme.
The Bush administration has said publicly that it will not permit Iran to acquire the nuclear bomb.
'We have plans'
Iran has always denied this, saying that its nuclear development programme is purely for peaceful, energy-generating purposes.
Washington has not threatened the use of force, but the possibility of air strikes, although not easy, cannot be ruled out.
"I do not think that America is in a position to resort to the madness of attacking Iran," President Khatami said in an interview with Iranian radio during a visit to Uganda.
"We believe that the probability of America's attack on Iran is very negligible. America faces major problems in Iraq and elsewhere."
While hoping that such a day would never come, he said Iran has been preparing itself in "economic" and "technical" terms.
President Khatami said: "While not welcoming any tension, while defending our interests and while trying to move ahead with logic, we have prepared ourselves and will prepare more, should they - God forbid - resort to acts of aggression; and we have plans for such a day."