Ayatollah Ali Khamenei has maintained his power in Iran for nearly 25 years. Photograph: EPA

In a closely guarded compound in central Tehran, often referred to simply as Beyt (the house), lives a 75-year-old man whose tenure as Iran’s supreme leader will expire only on the day he dies. Ayatollah Ali Khamenei, one-time revolutionary, has maintained his job-for-life as the politician with ultimate power in Iran for nearly 25 years. But recent news about his health has revived debate on who will replace him and what it will mean for the future of Iran.

The supreme leader is more powerful than Iran’s elected president, trumping him on decisions of national security and sensitive international issues as well as domestic policy.

In September, pictures of an ailing Khamenei in a Tehran public hospital following prostate surgery triggered speculation about the succession. Although the topic of succession remains taboo at home, when it comes, Iran’s political trajectory will change after a quarter of century, domestically and internationally.

Many wonder why Khamenei’s inner circle allowed his health development to be discussed in public, especially when Iran and the west have locked horns over important nuclear negotiations.

Ali Ansari of St Andrews university said Khamenei’s pictures in hospital were meant to send a signal that he was fit and healthy. “I think it has more to do with the fact that they are anxious,” he told the Guardian. “It tells us more about the general anxieties they have in the political system, the fact that it’s so dependent on him now that people are worried that if rumours get out that he is ill, people are going to start manoeuvring. This is a way to silence that in a way and I think they wanted to do it very deliberately.”

The son of a religious scholar born at the time of the Pahlavi dynasty, Khamenei rose from a seminary student to become Iran’s supreme leader in 1989 following the death of Rouhollah Khomeini, founder of the 1979 Islamic revolution. Today, in the words of prominent Iranian writer Akbar Ganji, Khamenei is “Iran’s head of state, commander in chief and top ideologue. His views are what will ultimately shape Iranian policy.”

Khamenei was appointed to his new job by Iran’s assembly of experts, a powerful clerical body in charge of appointing and dismissing the supreme leader. Two decades after that appointment, Khamenei has become so powerful that the assembly’s role has diminished to a symbolic one with members acting as his devotees, stripped of all their supervisory power even though they are still being elected in public votes.

One analyst with close knowledge of Iran’s political structure said the assembly would regain its decisive role at the time of Khamenei’s death. “We shouldn’t underestimate the assembly,” said the analyst who preferred to remain anonymous. “At the end of the day, they are the very people who choose the next leader unless there will be a military coup.”

In Tehran, the assembly is in transition mood. Mohammad-Reza Mahdavi Kani, who was the council’s chairman until a few weeks ago, died following a heart attack and the next elections for a new set of members is scheduled in less than two years. “What happens after Khamenei very much depends on who is in the assembly at the time of his death and what forces are in power in Tehran,” said the analyst.

Ahmad Janati, a powerful Iranian cleric and a close confident of Khamenei, warned last month that certain political factions in Iran were already planning for greater influence in the next assembly of experts, implying that clerical groups critical of the establishment were hoping to enter the body. “Some individuals have political ambitions and want to have the upper hand in the next assembly,” he said during a television interview last month without naming anyone. “I’m not sure if they are bona fides.”

If Khamenei died tomorrow, Ansari said, there were three ways in which a succession could proceed. “The assembly of experts will convene and activate the notion of the leadership council,” he said. “The other one is that he would have left some sort of will and nominate someone who I think will be from the inner circle, someone who would continue his vested interest. Or it will be a new person elected in the traditional sense. This one is the most problematic.”

In the absence of serious political discussions about Khamenei’s successor, the names of potential candidates are touted only in private. Many see Ayatollah Ali Akbar Hashemi Rafsanjani, one of Iran’s great political survivors, as a serious contender, even though he is older than Khamenei. The 80-year-old Rafsanjani, head of the country’s powerful expediency council, has held Iran’s presidency twice and has led the assembly of experts for some years.

Rafsanjani stepped down from his top assembly role in 2011 as it came to light that a rift was emerging between him and Khamenei over the conduct of Mahmoud Ahmadinejad, then president. Because of his differences with Khamenei, Rafsanjani’s authority has diminished in recent years and two of his children have been jailed on separate charges but later released. He registered to run for Iran’s presidential elections in 2013 but his candidacy was blocked by a powerful council close to Khamenei which is in charge of vetting all candidates. Rafsanjani is now seen as close to reformists and moderates.

Other names are also heard as possible candidates, include Ayatollah Mahmoud Hashemi Shahroudi, a former head of the judiciary, Ayatollah Mohammad-Taqi Mesbah Yazdi, a hardliner figure, Ayatollah Javadi-Amoli, a prominent scholar based in the city of Qom and Ayatollah Ebrahim Amini, an influential cleric and an assembly member.

Three possible candidates touted to become Iran’s next supreme leader:

Ayatollah Ali Akbar Hashemi Rafsanjani: The 80-year-old moderate politician was among the founding members of the Islamic republic and its president, from 1989 to 1997. He is well known for his pragmatism and is one of Iran’s great political survivors. After the 1979 Islamic revolution, Rafsanjani became the country’s first speaker of the parliament, a job he kept for nine years. During the Iran-Iraq war, he was supreme leader Ayatollah Rouhollah Khomeini’s top representative in the supreme defence council, acting as the de facto commander-in-chief of the Iranian military. When Khomeini died in 1989, Rafsanjani played an instrumental role in the appointment of Ayatollah Ali Khamenei as the current supreme leader. He is the head of the country’s expediency council, which mediates between the parliament and the powerful Guardian Council.

Ayatollah Mahmoud Hashemi Shahroudi: The 65-year-old is a grand ayatollah with a strong following among Iran’s Shia population. He was born in Najaf, one of the Shia cities in Iran’s neighbouring country, Iraq, but migrated to Iran following the 1979 Islamic revolution when Khomeini deposed the late Mohammad Reza Pahlavi, who was Shah. In Iran, Shahroudi became a close ally of Khomeini and rose to become the head of Iran’s judiciary, one of the country’s main three political institutions, between 1999 until 2009. In 2011, Shahroudi was reportedly appointed by Khamenei to mediate between Mahmoud Ahmadinejad and the Iranian parliament (Majlis), which was critical of his government’s approach to MPs. He is also a member of the Guardian Council and considered relatively to be a moderate figure. Under Shahroudi’s watch in the judiciary, human rights abuses continued in Iran including the arbitrary arrest of activists, journalists and dissidents.

Ayatollah Mohammad-Taqi Mesbah Yazdi: The 80-year-old cleric, often referred to as Ayatollah Mesbah, is a hardline politician who supported the former president Mahmoud Ahmadinejad in his initial years in office. He is considered to be one of the country’s most hardline clerics. He is famous for his critical views about Iran’s reformist movement and in particular, his opposition to the presidency of Mohammad Khatami. He is a member of Iran’s assembly of experts and is touted to be the possible candidate for the country’s next supreme leader among the conservative and fundamental front. Mesbah is particularly well-known in the Iranian city of Qom, where a lot of theological colleges and schools are based. Although Mesbah is close to fundamentalists, he is not particularly seen as a close ally of Khamenei. The two are often seen as rivals.