By Babak Dehghanpisheh

BEIRUT (Reuters) - Images of Iran's Supreme Leader Ayatollah Ali Khamenei appearing frail and in bed have raised questions about the seriousness of his condition, and who might eventually succeed him.

In early September, Khamenei made a surprise announcement that he was having surgery and asked people to pray for his health. What followed was unprecedented in the 35-year history of the Islamic Republic.

Top officials including President Hassan Rouhani, the head of the judiciary and the speaker of parliament went to the 75-year-old Supreme Leader's bedside, with each visit reported with photos on Iranian news sites. Even former president Mahmoud Ahmadinejad, who has had a tense relationship with Khamenei in recent years, came for a visit.

Rumors about Khamenei have circulated for years. But there has never been such a media blitz on the health of the Supreme Leader, who holds substantial influence or constitutional authority over the executive, legislative and judicial branches of government as well as the military and media.

The head of the surgical team said Khamenei had an operation on his prostate which lasted less than half an hour and only local anesthetic had been used. He was completely awake and speaking during the procedure, the surgeon said.

But if Khamenei's health deteriorates, the traditional clergy and the Islamic Revolutionary Guard Corps - Iran's top military force and an economic powerhouse - will need to settle on a successor quickly if the country is to avoid a period of political instability, experts say.

"The illness of leaders in undemocratic countries is seen as a national security issue," said Mehdi Khalaji, a former senior fellow at the Washington Institute for Near East Policy who is now the CEO of the Idea Center for Arts and Culture.

TUSSLE IN STORE

So far, Iran has had only two Supreme Leaders since the 1979 revolution, with Khamenei succeeding the Islamic Republic's founder Ayatollah Ruhollah Khomeini in 1989.

Story continues

Supreme Leaders are elected by the Assembly of Experts, which is made up mostly of the clerical old guard. But it is clear that the Revolutionary Guards will also play a major role, experts say.

In the past year, the Revolutionary Guards have pushed back hard against attempts by the Rouhani government to curb their influence on economic and foreign policy as well as the country’s disputed nuclear program, the subject of negotiations between Iran and international powers.

Neither will they be easily sidelined on talks about a future Supreme Leader. "It's unlikely that the Revolutionary Guards will defer to a group of geriatric clerics regarding their next commander in chief," said Karim Sadjadpour, an Iran expert at the Carnegie Endowment for International Peace.

Ali Ansari, director of the Institute of Iranian Studies at the University of St. Andrews, predicted problems with the succession. "I don’t think it’s going to be smooth, whatever happens," he said. "There will be a tussle."

Khamenei was an unexpected choice after Khomeini’s death because he had not been seen as a senior cleric. But over the past 25 years he has solidified his grip on power, largely by gaining the support of the Revolutionary Guards.

KHAMENEI CALLS FOR UNITY

The process for choosing a new Supreme Leader became more complicated in early June when the head of the Assembly of Experts, 83-year-old Ayatollah Mohammad Reza Mahdavi Kani, fell into a coma because of a heart condition, according to a report by the Islamic Republic News Agency.

This led to speculation that high level negotiations and jockeying for power in choosing a new Supreme Leader may have already begun within the body.

At a meeting of the Assembly in early September, Khamenei himself called for unity. "There are differences in taste on political issues, on political issues small and large," he said, according to a transcript posted on his personal website. "But these differences cannot destroy the unity of the country or empathy within the country. Everyone should be together."

One possible candidate to succeed Khamenei is Ayatollah Mahmoud Hashemi Shahroudi, a former judiciary head who is deputy head of the Assembly of Experts. Shahroudi is seen as a candidate favored by Khamenei and, crucially, is thought to have the support of the Revolutionary Guards, experts say.

Another candidate is Ali Akbar Hashemi Rafsanjani, a former president who has been prominent in Iranian politics since 1979. But, at 80, Rafsanjani is seen as too old for the position and has a number of detractors among political hardliners.

A third possible candidate is Ayatollah Sadeq Larijani, the current head of the judiciary who has been twice appointed to the position by Khamenei. Larijani comes from a family of political heavyweights; one brother is the speaker of parliament and another has also served in government positions. However, he is not regarded as a senior cleric and is unlikely to muster much support among the old guard.

Whoever replaces Khamenei is unlikely to wield as much power in the same position. "The clergy are looking for somebody to guarantee the interests of the clergy. The Revolutionary Guards are looking for someone to guarantee the interests of the Revolutionary Guards," said Khalaji. "Neither of them wants somebody who can come in and control them."

Disputed presidential elections in 2009 led to mass street protests followed by a wave of arrests, including of two candidates who remain detained at their homes.

Given this, the complicated process of choosing a new leader and the transition of power that follows could also provoke unrest. "If this uneasy equilibrium is suddenly changed, you will have unintended uprisings or unintended consequences," said Abbas Milani, the director of the Iranian Studies program at Stanford University.

(editing by David Stamp)