There are rumours in Iran's corridors of power that Ebrahim Raisi, a former presidential candidate and custodian of the Islamic Republic's holiest shrine Imam Reza, would replace Ayatollah Sadeq Amoli Larijani as head of the country's judiciary in the summer of 2019. In recent comments to the media, Raisi himself did not rule this out.

The conservative cleric's appointment as chief justice would all but guarantee that he will be the next supreme leader of the country. If this happens, Iran's revolution would live on under the leadership of yet another hardliner, which would kill any remaining hopes among the Iranian people for political change.

A student of Khamenei

Fifty-eight-year-old Ebrahim Raisi is a student and loyal follower of current Supreme Leader Ayatollah Khamenei. Like his teacher, he hails from Mashhad and belongs to its famous seminary He is married to the daughter of Ayatollah Alamolhoda, a hardline cleric who serves as Khamenei's representative of in the eastern Razavi Khorasan province, home of the Imam Reza shrine.

Raisi joined Iran's judiciary in 1981 as prosecutor in the city of Karaj. He was promoted to the role of deputy prosecutor general of Tehran in 1985 and three years later, in 1988, he played a prominent role in the mass execution of thousands of political prisoners.

The appointment of Ayatollah Khamenei as the new Supreme Leader in 1989 sped up Raisi's rise in the ranks of Iran's judiciary. He became prosecutor general of Tehran in 1989, the head of General Inspection Organisation in 1994, first deputy Chief Justice of Iran in 2004, and attorney general of Iran in 2014. He is also a member of the Assembly of Experts - a deliberative body comprised of 88 ayatollahs which is empowered to designate and dismiss the supreme leader of Iran.

Since 2012, Raisi has also been serving as the prosecutor of the Special Clerical Court (SCC) or Dadgahe Vizheh-ye Ruhaniyat. The SCC was formed in the early years of the revolution to prosecute and punish clerics for misdemeanours. However, over the years the country's leadership transformed the court into a tool that helps them control and silence any dissident clergy.

In addition to his many senior judicial positions, in 2016 Ayatollah Khamenei appointed Raisi as the chairman of Astan Quds Razavi, the wealthy and influential charitable foundation which manages the Imam Reza shrine. Through this appointment, Raisi developed a very close relationship with the Islamic Revolutionary Guard Corps (IRGC), which is a known ideological and economic partner of the foundation.

In 2017, Raisi moved into politics for the first time and ran against incumbent President Hassan Rouhani in the presidential election saying it was his "religious and revolutionary responsibility". He managed to secure a respectable 38 percent of the vote; Rouhani won with 57 percent of the vote.

This result was initially seen as a sign of Raisi's relative unpopularity and the possible end of his political ambitions, but he has proven his detractors wrong. After his electoral defeat, he remained in the public eye and became an even more prominent political figure by criticising Rouhani's policies and pushing for hard line policies in both domestic and foreign affairs.

Thanks to large budget of the Astan Quds Foundation (estimated at $1-2bn), he has also been able to set up alliances with other clerics and build a vast network of branches capable of mobilising supporters across the country.

Raisi vs Rouhani

Raisi was the most prominent contender for Ayatollah Khamenei's post even before even before rumours started circulating about his possible appointment as the next head of the judiciary.

In fact, he, along with Rouhani, were seen as the two most likely successors of Iran's supreme leader. However, after his reelection in 2017, Rouhani's popularity collapsed as result of ineffective economic policies and exacerbated socioeconomic crises across the country.

He has many critics among the regime's hardliner elites and in a recent poll, some 84 percent of respondents said they were dissatisfied with his administration. Meanwhile, Raisi's popularity is rising.

As a prominent member of the Assembly of Experts, Raisi has significant influence over its deliberations. As the leader of the wealthy and influential Astan Quds foundation, Raisi has enough funds and political capital to buy the loyalty of many clerics who would have a say on who would replace Khamenei. And as the prosecutor of the SCC, he has the ability to intimidate any dissidents within the clergy, even high ranking ones.

Moreover, he wears a black turban, which indicates that he is a descendant of Prophet Muhammad. This confers a great deal of seniority in clerical culture and much respect (by contrast, both Rouhani and Larijani wear a white turban).

The next supreme leader?

Ayatollah Khamenei is nearly 80 years old and in poor health. Iran will soon need a new supreme leader and every indication is that Raisi will claim this post.

For now, there is only one scenario in which he does not become Iran's next supreme leader. According to Iran's constitution, in the event that the supreme leader dies and the Assembly of Experts cannot immediately decide who should fill the position, the country would be run by a provisional council consisting of the president, the judiciary chief, and one of the six members of the Guardian Council. The constitution does not specify an expiration date for this arrangement, allowing this council to run the country indefinitely.

In theory, if Raisi has not become the head of the judiciary by the time Ayatollah Khamenei dies, this would mean such a council could permanently block his appointment as the next supreme leader. However, if he gets appointed sooner, then he would secure a seat on the provisional council and nothing would keep him away from taking over the supreme leadership post.

Raisi is an ardent follower of Ayatollah Khamenei. Once he takes on the role of supreme leader, he will continue his domestic and regional policies. On the domestic front, he will further Iran's Islamisation and regionally he will push to strengthen the "axis of resistance".

Raisi's seemingly unavoidable appointment as Iran's supreme leader is going to be the final nail in the coffin of the Iranian people's hopes for reforming the clerical establishment. For many Iranians, his rise to power is going to prove that changing the system from within is impossible and only a new revolution can bring real change to the country.

Unfortunately, this realisation is likely to trigger yet another long and painful cycle of arbitrary rule, chaos, violence in Iran.

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