Once the darling of the desperately poor masses in Iran, President Mahmoud Ahmadinejad is fading fast in popularity and is considered by most of the world as dangerous and unpredictable.
Vilified in the West for his barbs against America and Israel, his defiance on Iran's nuclear work, and questioning of the Holocaust, the blacksmith's son has long relied on his charismatic appeal to the poor and devout, as well as his links to the elite Revolutionary Guard and Basij religious militia.
Many Iranians underestimated the little-known Ahmadinejad before he defeated political heavyweight Hashemi Rafsanjani for the presidency in 2005 and even later as he accumulated power.
His re-election in 2009, in a vote his reformist opponents said was rigged, ignited an eight-month firestorm of street protests - a failed foretaste of last year's Arab uprisings.
Ahmadinejad prevailed thanks to unwavering support from Supreme Leader Ayatollah Ali Khamenei, who abandoned his role as lofty arbitrator to fight for the president in a struggle that exposed gaping divisions in the religious and political elite.
But Ahmadinejad seemed only hungrier for power and challenged the authority of Khamenei himself, sacking an intelligence minister last year and then sulking at home for 10 days after the Supreme Leader reinstated the man.
Ultimate power, however, remains with Khamenei.
"Iran has become a one-party system: the party of Khamenei," said Karim Sadjadpour, an Iran analyst at the Carnegie Endowment. "The most important qualification for aspiring members of parliament is obsequiousness to the Supreme Leader."
Ahmadinejad may pay the price for failing to conform to this rule in a March 2 election expected to erode his support in parliament, which has summoned him for an unprecedented grilling next month, mainly over his handling of the economy.
With UN sanctions finally beginning to bite - at least for ordinary Iranians - it is likely that key allies of the president in parliament will be defeated. But a wounded animal is a dangerous animal and Ahmadinejad may yet lash out at his domestic or foreign foes. He is not powerless by any means and there are factions in the government and clerical establishment that still support him.
But one analyst pointed out that Ahmadinejad "has shown a unique ability to lose friends and alienate people." That will probably prevent him from naming his own successor when he exits the presidency next year, and leave the field open to Khamenei to put a puppet who will do his bidding into office.