Over the past three weeks, many analysts have focused on how the assassination of General Qassem Soleimani will affect the Iran-US confrontation in the Middle East. Little attention has been paid, however, to the effect his death will have on the internal affairs of Iran.

The general, who headed the Quds Force of the Islamic Revolutionary Guard Corps (IRGC), was an important figure not only in driving the Islamic Republic's power projection abroad but also in shaping its domestic narrative and political dynamics.

Even before his death, Soleimani had assumed an almost mythical status for both the Iranian public and Iranian sympathisers abroad. In the eyes of religious people, he was the protector of the shrine of Sayeda Zainab, venerated by the Shia, and the hero who stood up to Israel and supported the Palestinian resistance. In the eyes of nationalists and those who do not believe in the Islamic Republic at all, he was the brave commander who fought terrorists and foreign enemies trying to destroy Iran.

He was never named in any corruption allegations, internal political squabbles or crackdown on protests and dissent, as other IRGC commanders were. He spoke Arabic and had spent a long time in the Arab world; he had good relations with Hezbollah, Hamas and the Islamic Jihad. This made him the appropriate face for Iran's campaign to expand its influence in the region in the aftermath of the 2003 United States invasion of Iraq.

The mythical status of Soleimani was necessary to build an image of a powerful Iran internally and externally, to cover up the reality of a besieged nation. Inside Iran, even young people, who are far removed from the first and second generations of the revolution and its ideals, still believe in Iranian supremacy. The image of Soleimani nourishes this belief.

As such, it should not be surprising to see a young woman whom the morality police might castigate for dressing in an "un-Islamic" way mourn him at his funeral. It is the same reason that motivated a well-known liberal novelist like Mahmoud Dowlatabadi, who criticised what happened after the Iranian Revolution of 1979 in his is famous novel The Colonel and who is known for his opposition to the government, to praise Soleimani during his life and mourn his death with great sadness.

The assassination of Soleimani gave his mythologisation a new momentum. His image became a mixture of the Ashoura heroism of Imam Hussein, the grandson of Prophet Muhammad who revolted against the Umayyad ruler Yazid and was tragically killed, and the heroism of the characters in Shahnameh (the Book of Kings) written by the Persian poet, Abu Qasem Ferdowsi.

The mythical status of Soleimani, however, did not emerge spontaneously.

He joined the IRGC just as General Mohsen Rezaee had become its commander-in-chief. Under his leadership, the IRGC became an institution with strong foundations and a broad mandate. It trained and employed not just military and intelligence personnel but also experts in economics, politics, psychology and sociology. Its activities and projects were always carefully planned and executed - and so was the rise of Soleimani.

Mythologising his feats abroad was a perfect way to justify interference in the Arab region - both at home and abroad.

Had it not been for the Ukrainian plane tragedy, the momentum behind Soleimani's mythologisation would have been stronger. The accident greatly diminished the political gains that the Islamic Republic and the conservative political current close to Supreme Leader Ayatollah Ali Khamenei could have achieved inside Iran.

Yet it would be an exaggeration to claim that the emotional momentum among Iranians towards their hero turned into discontent overnight. A few images of angry protesters tearing up posters of his image after the plane crash do not negate the fact that Soleimani remains widely popular among Iranians.

One of the most important consequences of his death is that it undermined plans for the IRGC to assume a greater role in politics, as the Islamic Republic prepares for a handover of power from an ailing Khamenei to a successor.

The IRGC was kept out of politics for a long time due to the opposition of the founder of the Islamic Republic, Ayatollah Ruhollah Khomeini, to the participation of the military, including the IRGC, in any political activity. He considered it to be contrary to the values of the revolution.

The situation changed in 1989 when Ayatollah Khamenei became the supreme leader and brought the IRGC closer to the centre of power. The late Rafsanjani, on the other hand, facilitated the IRGC's involvement in the economy during his tenure as president between 1989 and 1997, when the country was undergoing reconstruction after the devastating war with Iraq (1980-1988).

The influence of the IRGC grew steadily and in 1999, two years into the first term of reformist President Mohammad Khatami, they publicly flexed their muscle. Twenty-four IRGC commanders, among them Soleimani, signed and sent a letter to Khatami in response to what they saw as his mishandling of a student protest, effectively threatening him with a coup.

Since then, the IRGC has sought to turn its successes in the region defending the nation - a task in which Soleimani played a significant role - into political gains at home. It is not far-fetched to speak of Soleimani as the most qualified to benefit from such gains due to his popularity.

This view is evidenced by General Soleimani's intensive political activities in the few years preceding his assassination. Although his work was secretive, in recent years he would often have photos of himself on his missions released to the public.

Then last year, he appeared at a rare meeting between Ayatollah Khamenei and Syrian President Bashar al-Assad, who had come to Tehran. The absence of Iranian Foreign Minister Mohammed Javad Zarif from the meeting demonstrated the growing importance of the IRGC in Iran's foreign affairs and resulted in the minister submitting his resignation in protest.

This and other developments over the past few years led some to believe that Soleimani was preparing to take on a political role. It was rumoured his name was going to be put forward at the 2021 presidential elections.

His death and the downing of the Ukrainian airliner by IRGC, however, spoiled these plans. The latter incident allowed President Hassan Rouhani, whose administration has been increasingly sidelined by conservatives and the IRGC, to strike back.

In a veiled criticism of the IRGC and their confrontational stance towards the US and Europe, Rouhani recently said that there is no way to solve the problems of the economy without turning to the international community. According to him, Iranians voted in 2013 and 2017 to de-escalate tensions in the region and normalise relations with the rest of the world.

Rouhani's government was severely weakened by the failure of the nuclear agreement. The sanctions he had promised to eliminate came back and have wreaked havoc in the Iranian economy. His belief that Europeans could help him proved misguided. All the gains he had made by signing the nuclear deal in 2015, which placed him on the list of candidates likely to succeed Ayatollah Khamenei as the next supreme leader, disappeared the moment President Donald Trump changed the US policy towards Iran.

In this context, the upcoming two elections in February - for Parliament and for members of the Assembly of Experts (which, among other duties, is tasked with electing the supreme leader) - as well as the presidential vote in 2021 will be crucial.

Despite the weakness of the reformist and moderate camp, it still hopes to make a political comeback at the upcoming parliamentary vote, but the conservative current is already putting barriers before it.

Earlier this month, Rouhani criticised the decision of the Guardian Council, which vets candidates for elections, to disqualify thousands of people who had registered to run. "[There are] candidates from how many parties? From one party? This is not an election … People need diversity," he said.

Given the increasingly complex political situation in Iran, the upcoming elections will be far more than a simple conservative-reformist or conservative-moderate competition. In fact, it might transcend this dualism completely. Perhaps more importantly, this competition will have a significant impact on the succession plan for 80-year-old Khamenei.

If the upcoming Parliament brings forth conservative figures with strong ties to the IRGC, and if the next president belongs to the same camp, the circle will be complete with a supreme leader who shares the same intellectual and political orientation.

Under this scenario, one could expect former presidential candidate Ebrahim Raisi, who lost to Rouhani in 2017, to be a strong candidate for the post of supreme leader. Last year he was appointed chief justice of Iran so he can have an opportunity to regain the political popularity he had lost during his presidential campaign by clamping down on corruption. What makes him a likely candidate is that his intellectual orientation is largely consistent with that of the IRGC.

Although the election of a new supreme leader is the prerogative of the Assembly of Experts, various powers will seek to influence the vote, including the different political camps, the clergy in Qom and the IRGC, which seems poised to be the most influential player.

Whoever takes power at the different institutions - Parliament, government and supreme leadership - the main challenge they will face is to placate Iran's "protest society" - to use the words of political science professor Hussein Bashiry.

As exiled opposition politician Ebrahim Yazdi pointed out in his memoirs, Iran is still going through a very volatile period and it is still in pursuit of liberation, which started with the Tobacco Protest in 1890, followed by the Constitutional Revolution of 1906, the Mossadegh movement of 1953 and the Islamic revolution of 1979.

Indeed the Iranian society remains in a state of revolution, even if for its political leadership the revolution is over.

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