The confrontation comes after Ahmedinejad refused to accept the reinstatement of intelligence minister Heydar Moslehi and boycotted cabinet meetings for 11 days.
Moslehi was not present at a meeting Ahmedinejad attended last Sunday and left the second on Wednesday, according to some reports because the president asked him to leave.
Khamenei, who is not constitutionally allowed to intervene in cabinet appointments, ordered Moslehi’s reinstatement after Ahmedinejad sacked him in an apparent bid to help the career of the man he would like to succeed him, Esfandiar Rahim Mashaei.
Iranian MP Morteza Agha-Tehrani, described as the Ahmedinejad’s moral adviser, told his supporters on Friday that at a recent meeting the Supreme Leader had told the president to give Moslehi his job back or resign.
Khamenei’s supporters argue that disobeying him is tantamount to apostasy.
“The Supreme Leader is above the constitution … his powers are absolute,” hard-line cleric Kazem Sedighi told a crowd on Friday, prompting chants of “death to opponents of the Supreme Leader”, while powerful imam Ahmad Khatami reminded Ahmedinejad that he was “expected to obey him”.
Up to 25 of the president’s supporters have been arrested over the last few days, according to Iranian websites. One of them is the cleric who leads prayers at the presidential mosque, Abbas Amirifar, his personal exorcist, Abbas Ghaffari, and Mashaei, according to the semi-official Fars news agency.
Leaders of the powerful Revolutionary Guards have distanced themselves from the president, accusing Mashaei, who is Ahmedinejad’s chief of staff, of sorcery and deviation.
In 2009, after his contested reelection, Ahmedinejad appointed Mashaei his most senior vice-president, arousing bitter opposition among clerical hardliners, who believe that he wishes to reduce their power and strengthen elected officials.
He may also favour rapprochement with the US.
“Ahmadinejad apparently has been testing the ground for Mashaei to run as his successor in 2013,” writes Ali Akbar Dareini of Reuters. “But any such plan needs control of the intelligence ministry, whose files can potentially sink any political ambitions with facts or innuendo.”
The president seems to have found himself isolated in the latest confrontation, with Mashaei apparently in jail and an intelligence minister whom he tried to fire.