Several commanders of the Iranian Revolutionary Guard Corps, which is through to have played a key role in Ahmadinejad's disputed 2009 reelection, have also publicly denounced the president's political clique while vowing allegiance to the supreme leader.
In one of the latest attacks, Khamenei's deputy representative to the Revolutionary Guard, Mojtaba Zolnour, described Ahmadinejad's inner circle as the gravest danger in the history of Shiite Islam and said that it would weaken the foundation of the Islamic Republic. Not long ago, publicly using such terms against Ahmadinejad, once Khamenei's protégé, would have been unthinkable. But these days, they are considered normal rhetoric in Tehran.
"The head of the deviant current should be removed," said Zolnour, adding that it would be the only way for the government to clean itself.
"The deviant current" is a term Iranian officials now use regularly to refer to Ahmadinejad's inner circle and right hand man Mashaei.
Since 2009, Ahmadinejad has resisted calls to dismiss Mashaei, whose daughter is reportedly married to the president's son.
He faces a difficult choice. So does Khamenei.
Khamenei could give the green light for the impeachment of the man he once trusted and supported, even more so than previous presidents. But the price of such move could be high: it could lead to a political vacuum and political instability at a time when the public dissatisfaction with the state of the economy and rising prices is palpable.
Alternatively, Khamenei could keep Ahmadinejad in power while trying to weaken his presidency, just as he did to his predecessor, Mohammad Khatami.
His efforts might not be all that successful, as Ahmadinejad could cause even more trouble if provoked and doesn't seem ready to become a lame duck president.
Despite all the opposition he's facing and the unprecedented attacks, Ahmadinejad has not shown any sign of surrender. Reports suggest Ahmadinejad is not compromising for two reasons: first, because he sincerely believes he has widespread popular support; and second, because he seems to genuinely think he is connected to the Hidden Imam through Mashaei. This strange belief could help explain the accusations of sorcery that he and his entourage are facing.
It's not clear when and how the current row will end. But it will depend to a great extent on how much patience Khamenei still has left for Ahmadinejad, who has been described as the most divisive figure in the Islamic Republic.
This confrontation has shrunk the circle of those who are considered insiders in the Islamic establishment in Iran.
As one Tehran-based observer noted, Iran is now a country where most of the former officials are branded as members of "the sedition," a term coined to describe the Green opposition movement, and current officials are said to be part of a "deviant current."
Once again in Iran, if you are not with Khamenei, you're against him.