In early January, Iran experienced its biggest protest wave since the suppression of the Green Movement in 2009.

In spite of shaking the Islamic Republic, these demonstrations did not produce any major political changes. Leaderless and without a clear political goal, the protesters could not sustain the initial momentum. They had no support from the political elites; even reformists didn't back them fearing "Syria-isation" of Iran or losing their share of power.

Iran's coercive apparatus did its job and cracked down on the protests with severity. This and other protest movements in the future are unlikely to win the battle with the security forces as long as hardliners call the shots in Iran.

Yet, there might soon be an opportunity for change from the top. One of the biggest barriers to change and political reform in Iran has been Supreme Leader Ayatollah Khamenei, who has stood behind hardliners and promoted conservative politics.

But Ayatollah Khamenei is 78, and according to many reports, in poor health as well. So what happens when Khamenei dies?

Who will choose the next leader?

If Khamenei dies or is deemed unable to fulfil his duties, a three-member council will take over his functions. The council includes the Iranian president, the head of the judiciary and a theologian of the Guardian Council, a conservative body in charge of interpreting Iran's constitution. They will have the powers of the supreme leader until the Assembly of Experts, a body of 88 upper-level Muslim clerics, chooses the successor.

Members of the Assembly of Experts are elected by the Iranian people for eight years, after first passing through the filter and approval of the Guardian Council.

How and who the experts of the assembly will choose as the next supreme leader would depend on a lot of factors. One of them is the ideological make-up of the assembly.

{articleGUID}

The last election for the assembly took place in 2016. Some interpreted the result as a victory for moderates, who claimed they won 59 percent of the seats and unseated prominent hardline members. But some also saw it as a victory for the radicals, as the assembly chose one of the most prominent hardliners, Ayatollah Ahmad Janati, as its chairman with 51 votes.

As a result, it seems the assembly is divided into three main groups: pragmatists, hardliners, and independents. The independent group is the most important one because their swing votes can change the outcome. In addition, various political players will influence the decision of the assembly, including the Islamic Revolutionary Guard Corps (IRGC), the office of Ayatollah Khamenei (Bit-e Rahbari), various Muslim clerics and the government.

A chance for change

Ayatollah Khamenei has mentioned that his successor should be a revolutionary and has asked members of the Assembly of Experts not to be "timid" in selecting his successor. His office, Iran's deep state, is likely to support a hardliner; radical Muslim clerics and the IRGC are likely to back the same candidate.

However, the current Iranian president, Hassan Rouhani, who is also a senior Muslim leader and considered a pragmatist, also stands a chance of being selected as the next supreme leader. This likelihood is even higher if Khamenei leaves office or dies, while Rouhani is still president (his term ends in 2020).

As a member of the Assembly of Experts, President Rouhani has more power to lobby and influence the selection process. As a recently leaked video of the session in which the Assembly of Experts chose Khamenei in 1989 shows, a small group of members can wield a lot of power in selecting the leader. Rouhani is the most powerful man among the current members of the assembly. As president of the republic, he can co-opt and coerce the others and his bureaucratic, security and clerical background could help him set up alliances with different groups and power blocs.

He is the most experienced and respected Muslim leader on the international arena and is less ideological compared with the other members of the assembly. As a pragmatist, he has the support of technocrats and Iran's bureaucracy. He also has the backing of traditional Muslim clerics, who support the separation of religion and politics in seminaries.

Although the IRGC commanders mainly belong to the hardliner camp, the IRGC itself is not a monolithic entity. There are a number of pragmatists in high positions within the corps, including Rear Admiral Ali Shamkhani, the secretary of the Supreme National Security Council. Rouhani himself has extensive experience in Iran's military and security apparatus. He used to be deputy to second-in-command of Iran's joint chiefs of staff, member of the Supreme Defence Council and deputy commander of war in the 1980s. He was also national security adviser under Presidents Akbar Hashemi Rafsanjani and Mohammed Khatami.

Although Iranians who want to see a transition from theocracy to a democratic state know that Rouhani would not push for such radical change, they would still prefer to see him as supreme leader than a hardliner.

If he indeed makes it to the position of supreme leader, hardliners would be sidelined and technocrats and apolitical Muslim clerics would be empowered. Rouhani has adopted his mentor Rafsanjani's model of development for Iran; he wants to see this country become the "Islamic version" of China with a strong military and economy. He wants Iran to be a country which operates independently of the West but has a good relationship with it.

If Rouhani assumes the position of supreme leader, he would not bring radical political liberalisation. However, he would improve Iran's economy and expand civil liberties for the general population. Rouhani as a supreme leader would also have the power to reign in the security apparatus and curb its brutality. These policies, which would move Iran towards normalisation and socioeconomic liberalisation would be welcomed by Iranians who do not want to see foreign intervention or another revolution.

Rouhani's bid for the position of supreme leader is fraught with challenges. Unlike Khamenei, who didn't have any strong rivals in 1989, Rouhani has many challengers and is likely to face fierce opposition. If he does win, however, Iran would likely experience a major transformation.

The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial stance.