President Ahmadinejad has been criticised by some unexpected quarters
With the row over Iran's disputed election still bitterly dividing the country, President Mahmoud Ahmadinejad is now in a new dispute with fellow conservatives.
It is an argument every bit as heated as the election row, and potentially even more damaging to the president.
Just over a month after the election, Mr Ahmadinejad provoked fury amongst his fellow conservatives by promoting one of his vice-presidents, Esfandiar Rahim Mashaie, to the post of first vice-president.
The job would make him the president's second in command, the man who would take over if Mr Ahmadinejad was run over by a Tehran bus.
As Mr Ahmadinejad must have known it would, the appointment infuriated conservatives.
Mr Mashaie had already angered the establishment by suggesting that Iran was friends with the Israeli people, even though he shared the Islamic Republic's hatred of the state of Israel.
Esfandiar Rahim Mashaie is a powerful influence on Mr Ahmadinejad
For days Mr Ahmadinejad rode the storm, ignoring behind-the-scenes hints that Supreme Leader Ayatollah Khamenei was not happy with the appointment.
Then, finally, a letter from Mr Khamenei was broadcast on state TV, calling for Mr Mashaie to go.
The president had to succumb. But the row is now having more lasting damage.
On Sunday it was announced that Mr Ahmadinejad had sacked his intelligence minister, Gholam Hossein Mohseni Ejeie, after what sounds like a heated argument in a cabinet meeting over Mr Mashaie's appointment.
At one point it was reported that four ministers had left the government. That was denied.
Later, the Minister of Culture and Islamic Guidance, Mohammad-Hossein Saffar-Harandi, announced he had resigned.
It was said that Mr Ahmadinejad had not accepted that resignation, but as of Monday the situation remained unresolved.
Mr Saffar-Harrandi said the row over Mr Mashaie had weakened the government, and that is one of the more polite comments from within the conservative camp.
The conservative newspaper Tehran Emrouz described it as a "chaotic" day for the government.
Determined to provoke
Another conservative paper, Khabar, published the headline: "Dismissal - the consequence of objecting to Ahmadinejad".
MP Ali Motahari called on Mr Ahmadinejad to "control his nerves" and accused him of intentionally bringing tension to the country.
But Mr Ahmadinejad seems determined to provoke even those who should be his allies.
He immediately appointed Mr Mashaie as his chief of staff and one of his closest aides.
There is also a new job for Ali Kordan, the former interior minister who was impeached by parliament after falsely claiming to possess a doctorate from an institution he quaintly called the "London Oxford University".
Gholam Hossein Mohseni Ejeie was sacked after a heated cabinet meeting
The president has made him an inspector responsible for ministries and the government.
Mr Ahmadinejad's behaviour may seem counter-productive, but it is completely in character.
When in a corner, he likes to come out fighting. Compromise is not a word in his vocabulary.
But the reasons behind the row itself are harder to pin down.
In one version, Mr Mashaie is disliked by conservatives for his relative "moderation" in saying Iran was friends with the Israeli people.
Another analysis has it that conservatives are worried about Mr Mashaie's links with the controversial sect the Hojjatieh, members of which believe in the imminent return of the so-called hidden imam, the Mahdi, in an apocalyptic scenario.
Certainly Mr Mashaie has been seen as a very powerful influence on Mr Ahmadinejad.
The argument may also indicate unease amongst conservatives over the disputed election itself.
There are many in Iran who see Mr Ahmadinejad's re-election as a coup d'etat, in which the real winners were the Revolutionary Guards.
That worries even some dedicated supporters of the Islamic Revolution.
Guidance minister Mr Saffar-Harandi, for example, is not someone who could, by any stretch of the imagination, be called a moderate.
Mr Ahmadinejad has managed to alienate many fellow conservatives, figures like Ali Larijani, who now holds the powerful position of speaker of parliament.
The parliament, or Majlis, could be the next scene of confrontation.
Soon, Mr Ahmadinejad is expected to be sworn in for his second term in office. The planned date keeps changing, indicating possible arguments behind the scenes.
The death of Neda Agha-Soltan sparked international protests
Afterwards he must name his new cabinet to be approved by parliament. The present row shows that Mr Ahmadinejad is not likely to propose compromise candidates, and parliament is unlikely to give his nominees an easy ride.
Deadlock over the appointments could even lead to Ayatollah Khamenei being obliged to introduce some form of emergency powers, which would only further weaken his position.
Indeed, according to a strict reading of the constitution, the government would need a vote of confidence from the Majlis even to continue in office if the latest departures mean that more than half its members have been changed during Mr Ahmadinejad's first term.
Parliament has already shown it can cause big trouble for the president.
According to one member, 200 MPs - a majority - have written to Mr Ahmadinejad asking him to "correct his behaviour so that he follows the leader's opinion seriously".
Parliament has also set up a committee to look into the condition of detainees arrested in the post-election crackdown.
As much as Mr Ahmadinejad and Ayatollah Khamenei try to assert their power, it becomes clearer that they have become prisoners of their own constituency, right-wing conservatives.
Already there are whispers about possibly impeaching the president.
The key of course would be the position of the supreme leader, who would have to authorise such a move.
Either keeping or ditching Mr Ahmadinejad could be almost equally damaging to Mr Khamenei.
All of this must be deeply satisfying for the opposition, as it continues its campaign to have the presidential election result overturned.
But reports continue to emerge of brutal treatment handed out to some of the many opposition supporters still held in prison. Two more detainees are reported to have died, 24-year-old Amir Javadifar and Hossein Akbari, aged 20.
Iran is approaching the Arbayeen or 40th day ceremonies to mark the deaths of those killed in the violence that followed the election. In Shia Islam it is a major date, often the spark for huge protests.
Thursday will be the anniversary of the death of Neda Agha-Soltan, the young Iranian woman who has become a symbol of the protest movement.
By all accounts, opposition supporters are as angry and motivated as they were on the day after the election. Now they face a government divided to its very core.