The Prime Minister of Iran was a political post that had existed in Iran (Persia) during much of the 20th century. It began in 1906 during the Qajar dynasty and into the start of the Pahlavi dynasty in 1923 and into the 1979 Iranian Revolution before being abolished in 1989. History of the office Qajar era In the Qajar era, prime ministers were known by different titles. The post itself was mainly known as ataabak or ataabak-e a'zam (grand ataabak), or sometimes sadr-e a'zam (premier) at the beginning, but became ra'is ol-vozaraa (head of ministers) at the end. The title of nakhost vazir (prime minister) was rarely used. The prime minister was usually called by the honorific title hazrat-e ashraf. Reza Khan Sardar Sepah became the last prime minister of the Qajar dynasty in 1923. For a list of Iranian 'prime ministers' prior to 1907 see List of Grand Viziers of Persia. Pahlavi era In 1925, Reza Shah became Shah of Iran. He installed Mohammad-Ali Foroughi as the prime minister. In 1941 his son Mohammad Reza Pahlavi became Shah. He installed Mohammad-Ali Foroughi as the prime minister too. In 1951, Mohammed Mosaddeq became Prime Minister but was overthrown in a counter coup d'état in 1953. Amir-Abbas Hoveyda became Prime minister of Iran in 1965 and remained in office until 1977. Shapour Bakhtiar was the last prime minister of Pahlavi era. Islamic Republic of Iran After the Iranian Revolution of 1979, Ayatollah Khomeini installed Mehdi Bazargan as the Prime Minister of an interim government, which served until November 1979. The government resigned during the Iran hostage crisis, but mentioned that it has not been the sole reason, and the decision for mass resignation had been reached one day before the invasion of the United States embassy by the Iranian students. 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. Rajai served in the post until Banisadr's impeachment in June 1981, and was elected as president in the elections of July 24, 1981. Rajai chose Mohammad Javad Bahonar as his prime minister, but they were assassinated together in the Prime Minister's office only a few weeks later on August 30, 1981. When Ali Khamenei became president in the elections of October 1981, he