ANKARA (Reuters) - Former Iranian president Akbar Hashemi Rafsanjani, who died of a heart attack on Sunday in Tehran, was one of the political titans of post-revolutionary Iran and a friend to moderates who have now lost their chief supporter.
Analysts said his death at the age of 82 was a blow to Iran's pragmatist President Hassan Rouhani ahead of presidential elections in May as he played a key role in Rouhani's landslide election victory in 2013.
A seasoned politician, he headed the Expediency Council, a body which is intended to resolve disputes between the parliament and a hardline watchdog body, the Guardian Council.
"Rafsanjani was a very competent manager and a seasoned politician. He had been involved in politics for over half a century," said a former pro-reform top official on condition of anonymity.
Few politicians have wielded such influence in Iran since the 1979 Islamic revolution that toppled the U.S.-backed Shah. Rafsanjani was a skilled behind-the-scenes operator in the labyrinthine world of Iranian politics.
The spread of Iran's elite Revolutionary Guards' (IRGC) domain into the economy started in the early 1990s under Rafsanjani, who encouraged the IRGC to get involved in construction of the country after the 1980-88 Iran-Iraq war.
The wily Rafsanjani rankled hardliners in the lead-up to election to the assembly and parliament in 2016 by openly criticizing the Guardian Council, the body that vets candidates, for their large-scale disqualification of moderates.
For the Assembly election, Rafsanjani - whose nickname "Kuseh" means both "beardless" and "shark" for his unbearded face - backed a less-conservative bloc of candidates which included Rouhani.
The 88-member Assembly, which serves for eight years, has the authority to appoint and dismiss the country's top authority supreme leader. Rafsanjani led the Assembly from 2007 to 2011.
For many ordinary Iranians, Rafsanjani, born into a wealthy pistachio farming family, has been a figure of suspicion and grudging respect for amassing a vast fortune.
He lost a presidential election in 2005 to hardline Mahmoud Ahmadinejad, the little-known mayor of Tehran at the time, a defeat that indicated resentment toward Rafsanjani as part of the elite and the perception he served few interests other than his own.
Most analysts viewed Rafsanjani, president from 1989 to 1997, as the second most powerful figure in Iran after Supreme Leader Ayatollah Ali Khamenei.
"Rafsanjani was always Iran's second most powerful figure, even under (late founder of the revolution Ayatollah Ruhollah) Khomeini," said political analyst Hamid Farahvashian.
Iran watchers believe that he persuaded Khamenei to back a historic nuclear deal, reached between Iran and six major powers in 2015.
Under the deal Iran accepted to curb its sensitive nuclear programme in exchange for lifting of sanctions that took an enormous toll on Iran's economy. The sanctions were lifted in January 2016.
A relative of Rafsanjani told Reuters that the former president "always believed in the revolution".
"For him, the revolution was above everything. He always thought about this country's interests," the relative told Reuters from Tehran by telephone.
Rafsanjani will be remembered above all for persuading Khomeini to accept a peace deal to end the bloody Iran-Iraq war, during which one million people died.
Rafsanjani played a key role in the appointment of then-president Khamenei as the Supreme Leader by the Assembly of Experts in 1989 after Khomeini's death.
Khamenei was an unlikely choice to hold Iran's most powerful post but endured by holding fast to the anti-Western rhetoric of the revolution while empowering the military and neutralising potential rivals in the clerical establishment.
After Khamenei assumed the position of supreme leader, Rafsanjani was elected president for two terms. Rafsanjani consistently tried to promote reforms, a free market position domestically and supported a moderate position internationally.
Many politicians have described Rafsanjani as "a pillar of the revolution", while his pragmatic economic and foreign policies have always appealed to many Iranians.
After the disputed 2009 presidential election, he was slightly sidelined in Iran's complex political system after calling for the immediate release of political prisoners and freedom of the press.
After the election in 2009, when the results of the election ignited eight months of violent street unrest, Rafsanjani and his family came under fierce criticism from hardliners over their support for the opposition movement which lost the vote to hardline president Ahmadinejad.
His daughter Faezeh was arrested in 2012 on charges of “anti-government propaganda” during the 2009 vote. She was jailed for six months. Analysts said the sentence was aimed at pressuring Rafsanjani.
His son Mehdi was also arrested in 2012 upon his return to Iran after an absence of three years. Mehdi was sentenced to 10 years on corruption and security charges.
Writing by Parisa Hafezi; Editing by Stephen Powell