Reza Khan Sardar Sepah became the last prime minister of the Qajar dynasty in 1923.
After the Iranian Revolution of 1979, Ayatollah Ruhollah Khomeini installed Mehdi Bazargan as the Prime Minister of an interim government, which served until November 1979.
The post was left empty until Abolhassan Banisadr became president in January 1980 and chose Mohammad-Ali Rajai as his prime minister, mainly because of pressures imposed by Majlis representatives, especially those close to the Islamic Republic Party.
When Ali Khamenei became president in the elections of October 1981, he first introduced right-leaning Ali Akbar Velayati to the Majlis as his prime minister, but he was voted down by the then left-leaning majority of the parliament, which then forced their preferred prime minister to Khamenei, namely Mir-Hossein Mousavi.
The dispute finally ended following intervention by the Supreme Leader, Ayatollah Khomeini, who advised the president to accept Mousavi.