A rift is emerging between Iran's president and its supreme leader, prompting several members of the parliament to call for the impeachment of Mahmoud Ahmadinejad, who has not been seen in public for days.

Ahmadinejad has refused to appear at the presidential palace since Friday in what is being seen as a reaction to Ayatollah Khamenei's reinstating of a minister he initially "asked to resign".

Under pressure from Ahmadinejad the intelligence minister, Heydar Moslehi, a close ally of the supreme leader, stepped down on 17 April but was reinstated when Khamenei asked him in a letter to stay.

The president has not publicly shown his support for that decision and on Wednesday he refused for the second time to chair a cabinet meeting in which Moslehi was present. Ahmadinejad also reportedly cancelled an official visit to the holy city of Qom prompting reactions among conservatives that "the president was sulking".

Under Iran's constitution, the president is in charge of appointing cabinet ministers who will hold the ministerial office after the approval of the parliament but an unwritten law requires all officials to abide by the supreme leader.

Iran's opposition has speculated that Khamenei is worried about the increasing power of Ahmadinejad and especially his chief-of-staff Esfandiar Rahim Mashaei.

Khamenei is believed to be particularly concerned about two key positions in the cabinet, the ministry of foreign affairs and the intelligence ministry, where he traditionally has influence. Ahmadinejad's administration is also accused of losing billions of dollars of Iran's oil revenues in recent years.

Last December, Ahmadinejad sacked Manouchehr Mottaki without consulting Khamenei while the former foreign minister was in middle of an official visit to Africa. Mottaki was replaced by Ali Akbar Salehi, the former head of the country's atomic energy agency.

After the dismissal of Mottaki, Ahmadinejad's assertion of control over Iran's foreign policy became clear. By attempting to dismiss Moslehi, some analysts believe that Ahmadinejad is entering a new phase of extending his control over key positions in the run-up to the March 2012 parliamentary election.

Ahmadinejad enjoyed the full support of the supreme leader when Khamenei backed him in the disputed presidential elections in 2009. Independent commentators believe that Khamenei has realised "his mistake" by supporting a president who is seeking to surpass him.

Since the first signs of split emerged, several members of the Iranian parliament have called on Ahmadinejad to publicly support Khamenei's decision over Moslehi, a request he has so far declined. Some prominent figures in the powerful revolutionary guards have also asked the president to comply with the supreme leader.

On Tuesday, Parliament News, a website run by Iranian MPs reported that "the plan to impeach Ahmadinejad has begun" in the parliament, with 12 MPs asking for him to be summoned before them.

Conservatives believe that the increasing tension between Ahmadinejad and Khamenei stems from the growing influence of Mashaei, who is being groomed by Ahmadinejad as his possible successor.

Mashaei, whose daughter married Ahmadinejad's son, has become the most controversial figure in Iran, provoking harsh criticism from conservatives by favouring a greater cultural openness and opposing greater clerical involvement in the regime.

Mashaei, who champions a nationalist narrative of Iran's history, was himself forced to step down as Iran's first vice-president in July 2009 when Khamenei intervened in an unprecedented move and said in a letter that "the regime's expediency" required Mashaei to go. Ahmadinejad, to the surprise of many, then appointed Mashaei as his chief-of-staff instead.

Khamenei has tried to play down his confrontation with Ahmadinejad in recent days. In an official visit to the southern province of Fars last Saturday, he praised the achievements made by Ahmadinejad's government and told the crowd he only intervenes in the government's affairs when he feels that "the expediency is ignored". He added: "I won't allow as long as I'm alive, an iota of deviation of this massive movement of the nation."