Mahmoud Ahmadinejad, Iran's irascible, unpredictable but devout president, may be forced to resign in the coming weeks as a political crisis far greater than the massive street violence which followed his re-election in 2009 threatens to overwhelm him and his court favourites in the government.

The overweening influence of his close friend and confidant Esfandiar Rahim-Mashaee, the president's chief of staff – who is blamed for the firing of two intelligence ministers and for infuriating even the Supreme Leader, Ayatollah Sayed Ali Khamenei – is expected to bring down Ahmadinejad in one of the most spectacular putsches in the history of the Islamic Republic.

Iranian politicians are already speculating on who will succeed the president – Ali Akbar Salehi, the foreign minister and for four years the head of Iran'satomic agency, is a favourite – as three of Rahim-Mashaee's close allies have been purged in just three days over the past week, arrested by security agencies while Ahmadinejad has remained uncharacteristically silent. Mohamed Sharif Malekzadeh, who served briefly as Ahmadinejad's foreign minister; Ali Asghar Parhizkar, director of the Arvand free trade zone in the south of Iran; and his opposite number in the Aras trade zone in the north, Ali-Reza Moqimi, have all been charged with corruption, a dangerous accusation in the Islamic Republic where a fine line separates "corruption on earth" from "an enemy of God".

The darkness may soon close in over Rahim-Mashaee – the nearest Iran has to a government spin doctor – and thus embrace the man over whom he has allegedly cast a