REUTERS - Iran's supreme leader has told former hardline president Mahmoud Ahmadinejad not to stand again in next year's elections, state media reported on Monday, effectively eliminating a major challenger to pragmatist incumbent Hassan Rohani.

Ahmadinejad had not announced any plans to run in the vote scheduled for May, but has made several speeches in recent months, prompting speculation of a political comeback.

Commentators had suggested the firebrand populist, who frequently enraged the West with his rhetoric during his eight years in office, would have given Iran's conservatives their best chance of regaining power.

But the instruction by Iranian Supreme Leader Ayatollah Ali Khamenei, reported by state news agency IRNA, effectively destroys his chances of getting the wider backing he would need to run a successful campaign.

"He (Ahmadinejad) came to me and I told him not to stand as I think it is not in his interest and that of the country," Khamenei was quoted as saying.

"It will create bipolar opposites and divisions in the country which I believe is harmful," Khamenei added.

Rohani's popularity surged after last year's deal with world powers that lifted most sanctions on Iran in exchange for curbs on its nuclear program.

Another potential rival - Revolutionary Guard Commander Qassem Soleimani, the most high-profile face in the fight against ISIS in Iraq and Syria - said this month he would not stand in the vote.

Ahmadinejad was first elected president in 2005. His disputed win in the 2009 election prompted the Islamic Republic's biggest protests and a security crackdown in which several people were killed and hundreds were arrested.

Iranian law bars a president from seeking a third consecutive term. But Ahmadinejad would have been able to run again after the gap caused by Rohani's term.