Iranian President Mahmoud Ahmadinejad's position suddenly looks very precarious as he finds himself centre stage but alone under the glare of a spotlight focused on his country's most serious political crisis in two years.
His former champion, Iran's supreme leader, Ayatollah Ali Khamenei, has given him an ultimatum to accept the reinstatement of a cabinet minister or resign, according to reports from Iran.
Conservative parliamentarians, meanwhile, are threatening to impeach the president and, in a bizarre turn, several of his allies have been arrested in recent days after accusations that they used supernatural and occult powers to bolster his position.
The cleric leading prayers at Tehran University on Friday, Hojatoleslam Kazem Sedghi, indirectly criticised Mr Ahmadinejad while the crowd chanted: "Death to opponents of the supreme leader!"
Some analysts in Tehran suspect that the ayatollah is secretly preparing Mohsen Rezaie, a loyal, former head of the Revolutionary Guards who calls himself "the Leader's soldier", to replace Mr Ahmadinejad.
Mr Rezaie was one of four candidates in the June 2009 presidential elections and claimed, along with the two other ostensible losers, that the vote was rigged in favour of Mr Ahmadinejad. But he withdrew his complaint when the ayatollah decreed that election results must not be challenged.
"The long honeymoon between Khamenei and Ahmadinejad is ending in divorce," said an expert in Tehran, speaking on condition of anonymity. "Senior conservatives are referring to the president's camp as the 'deviant group', much like the leaders of the reformist Green Movement are branded 'leaders of the sedition'".
These developments are extraordinary. Less than two years ago the ayatollah risked his prestige as a supposedly neutral arbiter by giving his personal stamp of approval to Mr Ahmadinejad's fiercely disputed re-election.
The ayatollah ensured that the pro-democracy Green Movement, which contested the June 2009 vote result, was ruthlessly crushed by the Revolutionary Guards and its affiliated Basij street militia.
Now the regime is torn by infighting between rival conservative factions, which are jockeying for position ahead of parliamentary elections in March 2012 and presidential elections a year later.
One figure looms over the damaging rift at the regime's core. He is Mr Ahmadinejad's highly controversial chief of staff, Esfandiar Rahim Mashaie, whom the president is said to be grooming as his successor.
The two men, related by the marriage, have an unusually close bond dating back a quarter of a century.
The current crisis erupted on April 17 when Mr Ahmadinejad effectively sacked his intelligence minister, Heydar Moslehi, after apparently discovering that he was spying on Mr Mashaie.
The ayatollah, who intensely dislikes Mr Mashaie, promptly reinstated Mr Moslehi.
Mr Ahmadinejad responded by boycotting cabinet meetings for several days until last Sunday, when he pledged his allegiance to the supreme leader. But the president has yet to confirm officially whether he accepts Mr Moslehi's reinstatement.
On Friday, the cabinet's "ethics teacher" and close ally of the president, Morteza Agha-Tehrani, was caught on a mobile phone camera saying that the ayatollah had given Mr Ahmadinejad a deadline to publicly accept Mr Moslehi's reinstatement or resign. There has been no official confirmation of such an ultimatum.
But senior clerics had already warned that disobeying the supreme leader is equivalent to apostasy.
Mr Mashaie has infuriated prominent conservatives and leading clerics by championing Iran's nationalist heritage over its Islamic one. And, like Mr Ahmadinejad, he is opposed to greater involvement of the clergy in politics.
Hardliners also suspect that Mr Mashaie, who once claimed Iran could be friends with the Israeli people, wants to mend ties with Washington.
In a sign of Mr Ahmadinejad's diminishing powers, several of his aides, including two close to Mr Mashaie, have been arrested in recent days. One, Abbas Ghaffari, was said by Tehran's chief prosecutor to be involved with spirits and exorcism.
A sudden heart attack suffered by Mr Ghaffari's interrogator could be evidence of his occult powers, some Iranian news outlets suggested.
And a conservative website, Shafaf News, advised those questioning Mr Ghaffari to recite the Quran in order to prevent him summoning djinns - powerful spirits or "genies" which can be either good or evil - to harm them.
The commander of Iran's Revolutionary Guards, Gen Mohammad Ali Jafari, which has thrown its support behind the ayatollah, warned on Thursday that "deviations" driven by "djinns, fairies and demons" will not be tolerated.
Also arrested recently was Abbas Amirifar, a cleric who is the prayer leader at the presidential office. He has been linked to a controversial documentary entitled "The Coming is Near".
The film, distributed through millions of DVDs, suggests that the Hidden Imam, Mahdi, the revered Messiah figure of Shiite Islam, is about to appear soon. Conservative clerics insist the Mahdi's return cannot be predicted.
But Mr Ahmadinejad, who has long been fixated by the Hidden Imam, has claimed in numerous speeches that he will soon return to usher in a new era of justice and peace. The president's many clerical opponents insist he is unqualified to preach on religious affairs.
Mr Ahmadinejad was widely ridiculed when he claimed that a halo-like celestial green light descended on him when he spoke at the UN in 2005.
One of the president's leading critics in parliament, Ali Mottahari, scoffed last week that the Ahmadinejad camp, thinking the Hidden Imam's return is close, believe Iran no longer needs a supreme leader.
That is heresy under Iran's system of velayat-e faqih, or rule by an Islamic jurist.
The president's unswerving support of Mr Mashaie is losing him vital backing from powerful, erstwhile supporters such as the firebrand ultra-conservative Ayatollah Mesbah Yazdi. The cleric recently accused Mr Mashaie of seeking to create a "Masonic organisation" and "to deal a blow to Islam on a daily basis".
Some analysts believe Mr Ahmadinejad has no choice but to bow to the supreme leader's command, which could leave the president a lame duck for his last two years in office.
But others suspect the president will not succumb without a fight.
"Not only is the president immensely stubborn, but he thinks he is more popular than Khamenei," a senior analyst in Tehran said.
If it comes to the crunch, few doubt that Ayatollah Khamenei will win. The supreme leader has the support of the conservative majority in parliament, much of the clerical establishment, and the immensely powerful Revolutionary Guards.
Iran's state television will be a weather-vane. "So far it's been very supportive of Ahmadinejad," an analyst in Tehran said. "But if they change their attitude it will be a sure signal that Khamenei has decided to get rid of him."