Mr Khatami, the most liberal president since the revolution, should have a good chance of unseating Mr Ahmadinejad, arguably the most conservative leader in that time, says the BBC's Jon Leyne, in Tehran.

However, he will face tough opposition from hardliners in the clergy and military, our correspondent adds.

Mr Khatami urged a free election, saying the fate of the Islamic Revolution was at stake.

"Is it possible to remain indifferent toward the revolution's fate and shy away from running in the elections?" he asked at a news conference in Tehran.

"I consider this as a right to run in this stage. This candidacy doesn't deprive others and the path is open. What should be stressed is that the elections must be held freely."

'Desire for change'

It should prove an intriguing contest in June, our correspondent says.

Mahmoud Ahmadinejad has been a controversial figure

In this 30th anniversary year of the revolution, it will give Iranians a stark choice over the future of the Islamic Republic.

One other obstacle for Mr Khatami, Jon Leyne adds, is that his old supporters were disillusioned by his failure to push through more changes when he was in power.

Therefore, the challenge will be persuading them to go out and vote.

Mohammad Ali Abtahi, a close aide of Mr Khatami, warned that the results of elections in Iran were always of "serious concern" - an apparent reference to vote-rigging.

"But if the voter participation is high, we can easily win the election," he told AFP news agency.

This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.