UPDATE 0800 GMT: We have latest news and further snap analysis in our LiveBlog for Tuesday.
Mr Tehrani analyses for EA:
The Iranian government has some special characteristics. The Foreign Minister, together with the Ministers of Defense and Intelligence, are generally considered to be outside the control of the President. The incumbents for these ministries are usually strictly controlled by the Supreme Leader, Ayatollah Ali Khamenei.
Khamenei has a special attachment to the Foreign Ministry, for ever since the start of his first Presidential term in 1981, Khamenei has exerted control over the Minister. Despite the opposition of the then Prime Minister, Mir-Hossein Mousavi, in the late 1980s, Khamenei succeeded in installing a close associate, Ali Akbar Velayati, as foreign minister. Velayati kept his position until Mohammad Khatami's presidential triumph in 1997, when he was replaced by another Khamenei loyalist, former UN ambassador Kamal Kharrazi.
When Kharrazi's tenure ended in 2005, two names were shortlisted: Ali Akbar Salehi, then a senior official with the Organisation of the Islamic Conference in Jiddah, and Manouchehr Mottaki, the campaign for Ali Larijani's Presidential campaign. Mottaki's choice was probably due to the ascendancy of his mentor Larijani, who also became head of the Supreme National Security Council, Iran's real body for making foreign policyy. Khamenei probably chose to distribute positions amongst conservatives, as Ahmadinejad was an unknown quantity at the time and internal harmony amongst the conservatives was needed after the rout of the reformists.
In short, Foreign Ministers in the Islamic Republic have been long-serving loyalists of Khamenei and not prone to being removed by Parliament or President.
Five years later, the conservative harmony is in tatters. Larijani long ago left the Council position and has become a trenchant critic of Ahmadinejad. Mottaki was incensed a few months ago by the creation of a separate council, led by the President's Chief of Staff Esfandiar Rahim-Mashai and composed by his cronies, which had the aim of putting foreign policy directly into Ahmadinejad's hands.
This was partly accomplished by Saeed Jalili's successful survival at the helm of the Security Council, where he has surpassed Larijani's reign by a year. In the last few months, Mottaki's position had effectively degenerated to that of a spokesperson for Iran's foreign policy or a useful idiot who would appear in front of cameras and repeat what others had decided. The mild-mannered former ambassador to Ankara and Tokyo did raise his voice on a few occasions, but it was to no avail. In the pecking order of Iran's convoluted foreign policy apparatus, he was nowhere near the top, his mentor Larijani locked in a separate power struggle with the President.
Mottaki's removal required the approval of Supreme Leader. And it is here where there was a significant shift. This summer, Mottaki had threatened resignation over Ahmadinejad's power grab with his "special envoys", and Ayatollah Khamenei had intervened, chiding the President for an attempt at a "parallel" foreign policy.
This time Khamenei did not save Mottaki. Why?
One factor may be the new Foreign Minister. Ali Akbar Salehi, the head of Iran's Atomic Energy Organization, was a natural choice. The urbane and well-educated Salehi, whose ancestors hail from Iraq, has been a solid if discreet Khamenei loyalist over the years. In what may have been a telling precedent, the Supreme Leader accepted the resignation of another Khamenei-aligned technocrat, Gholamreza Aghazadeh, from the Atomic Energy Organization only when he was sure that Salehi was wiling and ready to fill his place.
Salehi's performance at the helm of the nuclear programme was also well-received by Ahmadinejad. Salehi was far more outspoken than his precedessor on Iran's nuclear rights and was more receptive of the President's anti-Western and anti-Israeli rhetoric. He was also adamant on the key guidelines of Iran's nuclear policy: little or no trust in the West and concession to it, moderate approval of the Turkish and Brazilian diplomatic initiatives.
At some stage, Khamenei probably gave his green light for Mottaki's replacement, but Ahmadinejad's disposal of Mottaki was most probably a surprise move, even for the Supreme Leader.
To show off his powers and humiliate his closest rivals, such as Larijani and Tehran Mayor Mohammad-Baqer Qalibaf, the President decided to do what none of his precedessors had dared or managed to do: fire one of the Islamic Republic's long-serving foreign ministers. Indeed, Ahmadinejad indulged in one of the more acute examples of his "bravado" behaviour, issuing a terse communique firing the Mottaki, just after the Foreign Minister had delivered a message from the President to his Senegalese counterpart.
The next few days will be instructive in the power game. The Parliament must confirm Salehi's appointment via a special vote of personal confidence. Should serious opposition to Salehi, or the method through which Ahmadinejad dispatched Mottaki emerge, this could be taken to represent Khamenei's displeasure at the President. A swift, quasi-consensual approval of Salehi, on the other hand be a severe setback for those who claim that Larijani and his "critical conservative" flank are functioning as a "loyal opposition" to Ahmadinejad.
The first comments from Parliament do not boding well for the President. The long-serving head of the Foreign Affairs and National Security Commission, Alaeddin Borujerdi, said that Mottaki's resignation "came out of the blue" for Parliament and that it was shocking to see such an edict delivered by Ahmadinejad while Mottaki was abroad on official business.
As for the bewildered former Foreign Minister, his inclusion within the Supreme Leader's own foreign policy unit --- currently staffed by both of his predecessors, Kharrazi and Velayati --- will be an indication that, despite yesterday's manoeuvres, he is still in Khamenei's favour.