The hard-line camp of Iran's ruling establishment has so far quashed a major challenge by reformists. The fight has gone to the streets and at least 20 people have been killed by official count.
But a much greater test may lie ahead.
Supreme Leader Ayatollah Ali Khamenei -- who has frequently backed the hard-liners -- is ill, and a succession battle looms.
Will the hard-liners leave the choice of the next supreme leader to chance?
There are signs they won't -- and one of these is the rise of an ultra-conservative group that has the ideological base, and increasingly the power, needed to skew the process.Theocratic, Democratic Tension
One of the great contradictions of the Islamic Republic of Iran is the juxtaposition of those two words in its name: Islamic and republic.
The juxtaposition is not by accident. The leader of the Islamic Revolution, Grand Ayatollah Ruhollah Khomeini, conceived of a state guided by a preeminent theologian whose supreme political position was enshrined in the constitution.
But the constitution itself borrowed many ideas from secular constitutions in the West, including provisions for an elected government, a parliament, separation of powers, and rule of law.
Since the founding of the Islamic republic, the tensions between theocracy and democracy have posed major challenges for the system's survival. In recent decades, they have twice turned into showdowns on the street: in the student protests of 1999, and now in the protests over the June presidential election results.
Both times, the protests applied public pressure on Iran to become more of a republic, where rule of law reigns supreme. And both times, the protests were quashed by hard-liners who used the de facto supremacy of the theocracy and vague revolutionary values to conduct arbitrary arrests, conduct closed-door trials, and censor the press.
The running battles with reformists undoubtedly give Iran's hard-liners plenty of reasons to wish the word "republic" wasn't enshrined in the country's name. And that wish appears to be a mobilizing idea for many top officials in the government.
Sanctioned By God
The best known is President Mahmud Ahmadinejad himself, whom reformists charge with winning a second term by fraud.
Ayatollah Mohammad Taqi Mesbah-Yazdi: "There has been deviance from our values..."
Ahmadinejad is a disciple of an ultraconservative cleric, Ayatollah Mohammad Taqi Mesbah-Yazdi, who believes that an Islamic state does not need to have any democratic aspects because its government is directly sanctioned by God. Such a state ideally would have no elections at all, because its rulers would be appointed by clerical experts divinely inspired to make the right choice.
Mesbah-Yazdi is politically engaged, has clear goals, and sees Ahmadinejad's hard-line government as the means to an end.
Two weeks before the elections, Mesbah-Yazdi issued a fatwah legitimizing any means necessary to keep Ahmadinejad in power. That was a religious green light for the thousands of people Ahmadinejad appointed to power in his first term -- including those in the Interior Ministry tasked with conducting the election -- to help Ahmadinejad if they had a mind to.
When Ahmadinejad was declared the winner of the election the day after the vote, he immediately went to see Mesbah-Yazdi.
There are not a few people who have wept at night at the sight of the rich harvest of the revolution wilting.
A videotape distributed by the cleric's supporters records the meeting. Ahmadinejad speaks with Mesbah-Yazdi in humble and religious terms of having reached a mutual goal.
"I would like to thank you, as an ordinary Iranian who is benefitting from this wave of righteousness which has swept the land," Ahmadinejad says. "I would like to thank you for your guidance in these matters and for your management of them. Also, I want to thank your friends the clerics who are working for this grand movement."
The language is as obscure as language can be when the speakers already know all the reference points. So, it is impossible for outsiders to say precisely what "matters" Mesbah-Yazdi has managed or how. But the mood -- as Mesbah-Yazdi punctuates Ahmadinejad's remarks only with an occasional "Inshallah" (If it pleases God) -- is celebratory.Incompatible With Democracy
Born in 1934, Mesbah-Yazdi is an accomplished scholar who became an ayatollah while still in his 20s. He runs three powerful educational institutions in Qom, all spun off from the Haqqani seminary, which teaches that Islam is incompatible with democracy.
In his public speeches, Mesbah-Yazdi has expressed his unhappiness with how the Islamic republic has changed since Khomeini's death in 1989.
"After the death of [Khomeini], there has been some disrespect shown to Islamic values, Islamic laws, and revolutionary values. There are not a few people who have wept at night at the sight of the rich harvest of the revolution wilting," he has said. "There has been deviance from our values, and we hope you can bring those values back. Reestablish abolished laws. Highlight those values which have been marginalized."
Mesbah-Yazdi appears intent on offering more than verbal criticism. The Haqqani seminary network combines ultra-conservative values with an emphasis on technocratic skills, the kind needed to run a government both while awaiting the Mahdi's return and afterward.
The Mahdi, the 12th descendant of the Prophet Muhammad, is believed by Shi'a to have gone into hiding as a child 1,300 years ago. Also called the "hidden imam," his return is awaited by the faithful as the moment when the world will be delivered from disorder, injustice, and corruption.Powerful Infrastructure
Besides Ahmadinejad, there are already several other key leaders in the government believed to be influenced by Mesbah-Yazdi.
The most prominent is Major General Mohammad-Ali Jafari, who became the top commander of the Revolutionary Guards in 2006. Another is Intelligence Minister Gholam-Hussein Mohseni Ezhei, and still another is anticorruption chief Hojatoleslam Mustafa Pur-Mohammadi, both of them Haqqani alumni.
It is this coherent and increasingly powerful infrastructure that could be brought into play to help steer the future course of the Islamic republic farther toward Islamic values and farther away from republican ones.
Anoushirevan Ehteshami, a professor of international politics at Durham University in England, says Ahmadinejad's government tried to make the electoral process irrelevant by rigging the results of last month's presidential poll. But he says the public reaction shows that the ultraconservatives have yet to find the final way to reach their goal.
"Definitely the government will have to find a better strategy in the future for dealing with this issue of people's participation, because the regime cannot accept the way people this time are expressing their demands and not giving up, and not ignoring the fraud which took place in this presidential election," Ehteshami says.
Immediately after the election, Supreme Leader Ali Khamenei endorsed Ahmadinejad as president-elect and called the claimed landslide victory a "divine miracle."
That enabled the government to crush the opposition protests with overwhelming force.
But the fact that the government could not have done so without the ailing Khamenei's support only underlines the importance of controlling the person who succeeds him.