Ahmadinejad v Ayatollah: Who will win Iran dust-up?
As Iran's president squares off against the country's chief ayatollah, the BBC's Iran correspondent James Reynolds asks if, this time, President Ahmadinejad is punching above his weight.
Mahmoud Ahmadinejad likes to argue. Iran's president has made a career out of picking fights with (in no particular order): two consecutive US presidents; Iran's entire opposition Green Movement; most countries in the European Union; the commanders of Iran's Revolutionary Guard; and a sizeable chunk of Iran's conservative MPs.
Perhaps feeling that this list was incomplete, Mr Ahmadinejad has now added one more opponent to his list: Iran's Supreme Leader Ayatollah Ali Khamenei or, more simply, his own boss.
"I think Ahmadinejad is someone who has profound delusions of grandeur, someone who is not content playing second fiddle to the Supreme Leader," says Karim Sadjadpour of the Carnegie Endowment in Washington DC.
"He sees himself as a revolutionary and a visionary leader… This smack-down of Ahmadinejad was somehow inevitable because Ahmadinejad was not content with merely being a president."
The fight between the president and the supreme leader has broken out because the two men have different visions for the future of Iran.
Ali Khamenei wants to preserve the Islamic Revolution - exactly as Ayatollah Khomeini bequeathed it to him more than two decades ago.
But Mr Ahmadinejad wants to change it. He and his allies want to take power away from the clerics.
But in Iran, there is only room for one ultimate decision-maker. That is the supreme leader - not the president.
Ayatollah Ali Khamenei has a long-lasting alliance with the Revolutionary Guard, the military force which protects the Islamic Revolution. This alliance forms the bedrock of the Supreme Leader's power.
The parliament takes the side of the ayatollah and the Revolutionary Guard.
Mahmoud Ahmadinejad may have considerable popular support among Iran's working class. But he has none of the levers of power possessed by the ayatollah.
So, when Mr Ahmadinejad tried to fire the Intelligence Minister in April, the ayatollah was able to overrule him easily. (The president responded by going into a 10-day public sulk.)
The Supreme Leader and his supporters in the Revolutionary Guard are also looking to what happens after 2013, when Mahmoud Ahmadinejad's term of office comes to an end. The constitution bars him from a third consecutive term.
Mr Ahmadinejad has tried to position his close friend and former chief of staff Esfandiar Rahim Mashaei as his successor. Mr Mashaei has promoted the slogan "Islam without the clerics."
As a result, the Supreme Leader's office has gone after Mr Ahmadinejad, Mr Mashaei and their supporters. Some have been arrested - and even accused of sorcery.
Road to Versailles
One man who lives in a mansion outside Paris knows more than anyone else about what happens when a president and his supreme leader confront each other.
Abolhassan Banisadr was elected president of Iran in 1980. Like Mahmoud Ahmadinejad, he challenged his Supreme Leader - in his case, Ayatollah Khomeini.
And Mr Banisadr lost.
He was impeached by parliament a year after taking office. And he has spent the last three decades in exile. He believes that, in the end, both Ali Khamenei and Mahmoud Ahmadinejad will lose.
"Khamenei has already lost because he has no other option," says Mr Banisadr. "He made this man - made him president - and now he is ruining him. So what is left to be done after this? As the Arab movements have been chanting, the only option for him is to go."
But that may be more of a wish than a prediction.
The ayatollah and his powerful supporters in the Revolutionary Guard will not back down.
Mahmoud Ahmadinejad may think he can win. But he might remember what happened to the last man who tried to do what he is doing - and who now watches life in Iran from his living room on the road to Versailles.