The funeral of Iran’s former president Ali Akbar Hashemi Rafsanjani has turned into a rare display of public dissent as at least 2 million people packed the streets of Tehran to pay tribute to a man whose death has shaken the country’s political balance.

In what was thought to be the biggest crowd honouring a politician since the death in 1989 of Ayatollah Khomeini, the founder of the 1979 Islamic revolution, Iranians from across the political spectrum attended the funeral.

All attempted to claim Rafsanjani, who died on Sunday aged 82, as their own as he was buried alongside Khomeini in a sumptuous shrine in south Tehran.

The supreme leader, Ayatollah Ali Khamenei, led the funeral prayers at Tehran University campus as critics and supporters stood behind him, bidding farewell to a man who was considered a pillar of the Islamic republic, a crucial mediator and, more recently, an advocate of political openness and better relations with the west.



But in the streets outside, mourners sympathetic to the opposition and supporters of Iran’s pro-reform Green movement, which was suppressed in bloody unrest in 2009, voiced dissent, chanting in support of Mir Hossein Mousavi and Mehdi Karroubi, opposition leaders under house arrest.



A video taken from the funeral that was posted on social networks showed a group of mourners saying “death to Russia”, in unusually strident criticism of the state’s staunch ally. “The Russian embassy is a den of spies,” shouted another group, a chant reminiscent of post-revolutionary tirades previously reserved for the US.

A mourner holds up a picture of Ali Akbar Hashemi Rafsanjani, who died on Sunday aged 82. Photograph: Xinhua/Rex/Shutterstock

Large numbers of Iranians are critical of their country’s role in the Syrian war, in which it is closely aligned with Moscow, but do not often have a chance to express their views.

Many mourners wore green wristbands, the emblem of the Green movement, and could face reprisals as a result.

Rafsanjani, who died due to heart complications, was Iran’s greatest political survivor and a leading force in its politics.

People visit Rafsanjani’s coffin. He was formerly president and de-facto military commander-in-chief. Photograph: Xinhua/Rex/Shutterstock

He was at one time the ultimate insider: a founding member of the revolution, a former de-facto commander-in-chief of the Iranian military during the Iran-Iraq war, and a two-time president seen as the country’s second-most powerful political figure for much of the Islamic republic’s history. His opponents say he jailed many of his critics.



But during his later years, his political allegiances shifted towards the reformists. In 2009, he sided with the Green movement and urged the state to release political prisoners and compensate their families.

Qassem Suleimani, the commander of the Quds force, made a rare public appearance at the funeral. Photograph: Tasnim News Agency/Handout/Reuters

As a result, he was sidelined and two of his children, including his daughter, Faezeh Hashemi, were imprisoned for supporting the opposition. In 2013, his campaign for the presidency was blocked, but he regained some of the popularity he had lost while in power, and the large numbers of opposition figures at his funeral showed he may have earned their enduring forgiveness.

Among the opposition figures with lengthy prison sentences behind them who attended the funeral was the student activist Bahareh Hedayat. A picture circulating online depicted Faezeh showing a victory sign, in a move that was seen as an indication of her continued support for change.

However, because the funeral was hosted by Khamenei, despite a rift with Rafsanjani in recent years, most of the people on the first row of prayers were Rafsanjani’s critics, including hardline clerics. Members of Rafsanjani’s immediate family were pushed on to the rows behind.

Iran’s establishment was out in full force, including Qassem Suleimani, the commander of Iran’s Quds force, the external arm of the powerful Revolutionary Guards, who made a rare public appearance.



The former president Mohammad Khatami, the leader of Iran’s reformist movement, was reportedly banned from attending the funeral. Khatami has recently faced restrictions on his movements because he is seen as a supporter of Mousavi and Karroubi. Local media have been banned from using his images or publishing his name.



While in power, Rafsanjani advocated better relations with Iran’s Arab neighbours. Officials from Turkey, Afghanistan, Bahrain – a country currently at odds with Iran – and even the White House press secretary expressed condolences.



Rafsanjani’s death has caused concern among many moderates in Iran about the country’s trajectory. Many believe his main legacy has been Hassan Rouhani, the president seen as his protege.

Faezeh Hashemi, Rafsanjani’s daughter, flashes a victory sign to the crowd from a bus during the funeral ceremony. Photograph: Vahid Salemi/AP

Reformists believe Rafsanjani’s death has tilted the balance towards the hardliners and they fear its implications on Iran’s presidential election in May, when Rouhani would have to seek re-election.



Officials from Tehran’s municipality announced on Tuesday that a street in the Iranian capital would be named after Rafsanjani.