During the final years of the Iran–Iraq War, Rafsanjani was the de facto commander-in-chief of the Iranian military. He was elected chairman of the Iranian parliament in 1980, serving until 1989. He played an important role in the choice of Ali Khamenei as Supreme Leader.
Rafsanjani became president of Iran after winning the 1989 election. He served another term by winning the election in 1993. In the 2005 election he ran for a third term in office, placing first in the first round of elections but ultimately losing to rival Mahmoud Ahmadinejad in the run-off. He and his family faced political isolation for their support of the opposition in 2009. Rafsanjani entered the race for the 2013 presidential election, but he was disqualified by the Guardian Council. With Hassan Rouhani's election, in which Rafsanjani openly supported him, the Rafsanjani family gradually recovered their political reputation. Rafsanjani died following a heart attack on 8 January 2017 in a hospital in Tehran at the age of 82.
Rafsanjani was born on 25 August 1934 in the village of Bahreman near the city of Rafsanjan in Kerman Province, to a wealthy family of pistachio farmers. He had seven siblings. His father, Mirza Ali Hashemi Behramani, was one of Kerman's famous businessmen and a Pistachio merchant. His mother, Hajie Khanom Mahbibi Hashemi, died at the age of 90 on 21 December 1995. One of his brothers, Mohammad Hashemi is the former director of IRIB. Rafsanjani did not see himself as a peasant from childhood, according to family members.