In a lengthy article in Tehran Bureau covering events from summer 2009 to the present, Muhammad Sahimi puts forward a picture of a developing contest between the Supreme Leader and President Ahmadinejad and concludes, The struggle and the gaping fissures that have emerged among the conservatives led by Khamenei, on the one hand, and Ahmadinejad and (presumably) the Guard hardliners, on the other, will bring their eventual downfall. This prospect is magnified by the administration's utter incompetence and corruption."
I differ from the analysis on the key point of the Supreme Leader leading a conservative blog against the President and the Revolutionary Guard --- my assessment is more that Khamenei is manoeuvring between contending factions, trying to hold them together --- and I think the portrayal of the politics, especially the nuclear talks with the "West", is incomplete. However, this is a wide-ranging review of the tensions EA has been noting for more than a year:
Although Khamenei firmly supported the election fraud and recognized Ahmadinejad as the elected president even before the Guardian Council certified the returns, friction between the two men began to emerge almost immediately afterward. Khamenei overruled Ahmadinejad's appointment of Esfandiar Rahim Mashaei as his first vice president (there are eight) in August 2009. The reason, never publicized, for Khamenei's decision was that in the 1980s, when Mashaei was an interrogator of political prisoners, he married a "repentant" former member of the Mojahedin-e Khalgh Organization. In that era, Mashaei, whose daughter is married to Ahmadinejad's son, was known as Morteza Moheb Oldlia.
A source in Tehran reports that Khamenei's order for the firing of Mashaei was delivered to Islamic Republic of Iran Broadcasting (IRIB) on the day he was appointed, but Ezzatollah Zarghami, IRIB director and a former Revolutionary Guard officer, refused to allow its announcement. Ahmadinejad waited one week to acknowledge the order and then sent the ayatollah a terse, very formal letter, devoid of the customary praises that his past letters to Khamenei had contained. He also referred to the Constitution as his basis for acceding to the directive, rather than the supremacy of Velaayat-e Faghih (guardianship of the Islamic jurist, as represented by the Supreme Leader), the hardliners' standard way of accepting such orders. In a further demonstration of defiance, Ahmadinejad appointed Mashaei as his chief of staff and special advisor. Since then, he has named Mashaei to 18 additional positions.
Shortly thereafter, the president fired Gholam-Hossein Mohseni Ejei, the hardline minister of intelligence. According to the Tehran source, Ejei was reporting to Khamenei without Ahmadinejad's permission. Ejei informed the ayatollah that the Intelligence Ministry had concluded that the Guard high command's accusations that the postelection demonstrations were linked to foreign powers and represented a "velvet revolution" were baseless. The ministry had determined that the demonstrations had neither been planned in advance nor could have been predicted. Ejei also told the ayatollah that both Mashaei and the cleric Hossein Taeb, then commander of the Basij militia, represented security risks --- Mashaei due to his marriage, and Taeb because he had played a leading role in the crimes committed against those arrested in the protests during their incarceration.
After prominent conservative Abdolhossein Rouh ol-Amini, a former Basij member whose son was murdered in Kahrizak, told Khamenei about the many crimes that took place at the detention center, the ayatollah ordered its immediate closure. Ejei had also complained to Khamenei that the Intelligence Ministry had lost control over the arrestees and that a Guard unit had taken control of the affair. In fact, as first reported by Tehran Bureau, Khamenei's original order was initially ignored by the Guards. Saeed Jalili, secretary-general of Iran's Supreme National Security Council and a close ally of Ahmadinejad's, later confirmed the Bureau story. It is now widely believed that the Ministry of Intelligence is controlled by the Guards' intelligence unit. Minister of Intelligence Haydar Moslehi is another close ally of Ahmadinejad.
Ahmadinejad has recognized that the ayatollah needs him more than he needs the ayatollah. When he sided with Ahmadinejad, the Supreme Leader lost any residual credibility that he had with a very large segment of the population. Contrary to what some claim, reliable sources in Tehran say that the ayatollah is keenly aware of the loss of his prestige and recognizes that his popular support has grown very narrow. Ahmadinejad recognizes his own lack of significant support, as well. So he has been active on two fronts: defying the ayatollah both covertly and openly, and trying to generate more support for himself.
Thus, after defying the ayatollah by giving Mashaei a portfolio of multiple prominent positions and firing Ejei, Ahmadinejad appointed Saeed Mortazavi, the hardline former Tehran prosecutor who was sacked after the Kahrizak fiasco, to another important post. To firm up his support among the Revolutionary Guards, he handed Guard-linked companies contracts totaling $21 billion....