(CNN) — Former Iranian President Akbar Hashemi Rafsanjani died Sunday after suffering a heart attack, Iranian state-run media said. He was 82.
Rafsanjani, who served two terms as Iran’s president from 1989 to 1997, continued to be an influential figure in Iranian politics.
At the time of his death he was the chairman of the Expediency Council, which aims to settle disputes between the country’s parliament and the Guardian Council.
Throughout his political career, the former president was seen as a conduit for better relations with the West.
In a sign of mourning, state television channel Islamic Republic of Iran News Network (IRINN) aired a black banner on the corner of its broadcast.
Rafsanjani was a vocal supporter of current Iranian President Hassan Rouhani. After his death, Rouhani posted praise on Twitter for the former president who once earned the nicknamed Akbar Shah, or Great King.
“The spirit of the giant of the revolution and politics, the symbol of patience and resilience has soared to the skies,” the tweet said.
Rafsanjani was seen as a key figure in Iran’s moderate movement, losing a presidential bid against the former hardline Iranian President Mahmoud Ahmadinejad in 2005.
During Ahmadinejad’s 2009 re-election campaign, Rafsanjani became a vocal critic, chiding the election results that gave Ahmadinejad another overwhelming victory.
“Ahmadinajad was largely seen as representing lower-class citizens, whereas Rafsanjani’s support base came from upper middle class … so to a degree, it was a class divide,” said Mohammad Marandi, an Associate Professor of North American Studies at Tehran University.
“He was one of the most intelligent people to ever enter Iranian politics. His alliances changed and shifted as he went along, which is not to say he was unprincipled. He was just very good at politics,” said Marandi, whose father served as the minister of health in Rafsanjani’s administration.
Rafsanjani was widely respected in political circles, even amongst his adversaries, Marandi added.
But among Iran’s people his legacy appears more mixed.
“His critics were unhappy with his liberal economic policies, which they say widened the gap between the rich and poor. Whereas his supporters say those policies helped build crucial infrastructure for the country,” Marandi said.
Iran’s Supreme Leader, Ayatollah Seyyed Ali Khamenei, also offered his condolences.
“I received the news of the sudden death of my old friend, companion in the years of the Islamic struggle … with sorrow and woe,” Khamenei said in a statement. “With the passing of Hashemi, there is no other person I know of with whom I share the long and common experiences of the highs and lows of these historic times.”