Akbar Hashemi Rafsanjani to Ruhollah Khomeini. This led to the establishment of Expediency Discernment Council, which later he chaired the council. He had an active role in Iran–Contra affair, which was divulged by Mehdi Hashemi and failed. Mehdi Hashemi was executed but Rafsanjani was the loser at internal dimension. In October 1981 presidential election, when he voted to Ali Khamenei, he said it's vote of "Imam (Khomeini), clerics and the parliament". During differences between Prime Minister Mir-Hossein Mousavi and Khamenei, Hashemi cleverly managed to keep the position favor or against these two perspectives and take the middle position. According to Bahman Bakhtiari, at
History of the Islamic Republic of Iran parliament. Despite high turnout and large enthusiastic crowds for reformist opponent Mir-Hossein Mousavi, Ahmadinejad was officially declared to have won by a 2–1 margin against three opponents. Allegations of voting irregularities and protest by Mousavi his supporters were immediate and continued off and on into 2011. Some 36–72 were killed and 4000 arrested. Supreme Leader Ali Khamenei declared Ahmadinejad's victory a "divine assessment" and called for unity. He and others Islamic officials blamed foreign powers for fomenting the protest. However, by late 2010 several sources detected a "growing rift" between Ahmadinejad, and Khamenei and his supporters, with talk of impeachment