Ali Akbar Velayati health from November 1980 to July 1981 in the cabinet of Mohammad-Ali Rajai. After winning the presidential election on 13 October 1981, then President Ali Khamenei proposed Velayati as his prime minister to the Parliament of Iran, but Parliament voted against him on 22 October. Khamenei later proposed Mir-Hossein Mousavi, who gained Parliament's approval. In November 1986, Velayati argued that Iran should have diplomatic ties with all countries. During the premiership of Mousavi, Velayati served as the minister of foreign affairs. After the election of Hashemi Rafsanjani as president, he retained his post until 1997, when Rafsanjani's term was ended.
Mir-Hossein Mousavi many others believed the results to be fraudulent, suggesting that the Interior Minister, Sadegh Mahsouli, an ally of Ahmadinejad, interfered with the election and distorted the votes to keep Ahmadinejad in power. Mousavi has claimed victory, and called for his supporters to celebrate it, sparking large protests as a result. Due to protests, from the opposition, the Supreme Leader ordered a partial recount of the election results. The recount was a random counting of 10% of the ballots. In order to create transparency, a 12-member council showed the recount on television, and concluded that President Ahmadinejad still led Mousavi after