Even by Iran's high standards of vicious political infighting, the power struggle gripping Tehran portends a noisy exit for President Mahmoud Ahmadinejad that could destabilize key pillars of the Islamic Republic.

Four months before presidential elections that will choose his successor, Mr. Ahmadinejad has made clear that he is disregarding orders to end his second term quietly, and instead is publicly taking on a host of political enemies in parliament and across Iran's Islamic regime.

"The fight is so serious, it's like they are going for the kill," says a veteran political analyst in Tehran, who could not be named out of concern for retribution.

"We have the expression in Persian, that they have 'fastened their swords on top of their clothes,' and are fighting in the open," says the analyst. "That has scared [to death] the rest of the establishment, and they don't know what to do with it."

A key Ahmadinejad ally and hardline former Tehran prosecutor, Saeed Mortazavi, was arrested and taken to Evin prison overnight yesterday after a bruising parliamentary fight the day before over his confirmation for a high-level post.

Ahmadinejad fought back from the parliament podium by accusing Speaker Ali Larijani and his brothers of corruption, and then played a secretly recorded video of one brother, Fazel, meeting with Mortazavi and apparently peddling family influence. The audio was scratchy, and Fazel Larijani later claimed it to be fake.

In a raucous exchange from the speaker's chair, Ali Larijani accused the president of "mafia-style activities," and actions that "corrupt the integrity of society." Lawmakers finally fired Ahmadinejad's labor minister, who had made the Mortazavi appointment.

But as Ahmadinejad begins a trip to Egypt today – the first by an Iranian president in the 34-year history of the Islamic Republic – Tehran is reeling. How the power struggle plays out will determine who will be allowed to run for president in June, and how it will be handled, in a process that senior officials are already anxiously obsessed about.

"Iran's conservative establishment is facing a security threat: Mahmoud Ahmadinejad," writes Mohammad Ayatollahi Tabaar, a professor at Texas A&M University, in Foreign Policy. "In a country where political campaigns have turned into massive social movements, normal elections are seen by the government as unusual security threats."

"Ahmadinejad, who is known in the West as the man who claimed Israel should be wiped off the map, is now feared by the establishment to be the catalyst for an existential threat to the Islamic Republic. He simply knows too much and is not willing to back off."

A supreme clash

Ahmadinejad has been adept at creating enemies during his eight years in office, and often warned that he had incriminating evidence against some of the highest authorities in Iran – which he would make public if his challengers went too far.

But Ahmadinejad's disputed reelection in 2009 – a vote that sparked weeks of street protests, and spread doubt in Iran about the legitimacy of the Islamic regime – has cast a pall over internal politics ever since.

Iran's supreme religious leader Ayatollah Ali Khamenei stepped into the fray in 2009, saying the popular choice of Ahmadinejad was a "divine assessment," and that those who did not accept it were "enemies."

Two of the men declared the losers in that election, former Prime Minister Mir Hossein Mousavi and former parliament speaker Mehdi Karroubi, remain under house arrest in Tehran. The Green Movement they helped create was long ago erased from the streets – if not from the minds of its pro-reform supporters.

Yet Ahmadinejad has since challenged Ayatollah Khamenei himself, and today is disregarding months-old advice from the Supreme Leader, who said that, before the June election, anyone who "tries to take differences to the public and use their feelings … will be committing treason."

Analysts expected that such clear orders from Khamenei might help mask internal rivalries, and maximize the appearance of harmony in conservative ranks before the vote.

But Ahmadinejad is a fiery and populist politician who has not shied away from attacking elitist pillars of the regime – even while his own senior appointees have been implicated in financial scandals worth billions of dollars, and the economy groans under the weight of US, European Union, and United Nations sanctions over Iran's nuclear program.

"It's like they are forgetting the outside pressures and avoiding all the daily problems that people are facing, [because] the only thing that matters is the rivalry," says the Tehran analyst. "The differences, when seen from outside, are so insignificant. But seen from inside they are irreconcilable, black and white, and a matter of no compromise."

Odd bedfellows

Speaking in Cairo today, Ahmadinejad said that Mortazavi's arrest was a "very ugly action."

"The judiciary is not a special family organization," Ahmadinejad said. "I don't know how it has happened that one person has committed an infraction, and another person is arrested. Instead of going after the violator, they go after the person who has announced the violation, and this is very ugly."

Mortazavi was forced to step down as Tehran prosecutor in August 2010, after a parliamentary investigation into the deaths of three anti-government protesters at a secret detention center called Kahrizak. Mortazavi is cited by Human Rights Watch as a "serial human rights abuser," and in US sanctions documents for "sustained and severe violations of human rights." He was notorious during the reform era 10 to 15 years ago for spearheading the arrest of journalists and closing newspapers.

Mortazavi also played a key role in crushing dissent in 2009 and incarcerating hundreds of political prisoners, but has since been inexplicably brought back to prominence by Ahmadinejad.

In recent months, Ahmadinejad portrayed himself as the only honest and accountable politician in Iran.

"Is everything in order in this country and only [my] administration has a weakness?" he asked, in a translation quoted by analyst Tabaar. "I am probably the only official who is not afraid of going out to the people. I have no fear. I swear to God I have no fear."

"These are the words of a man, who appreciates the depth of the unpopularity of the regime and its old guard," notes Tabaar. "In a region that has recently witnessed the bloody removal of leaders such as Libya's Muammar al-Qaddafi, these are unmistakable codes."