Mohammad Shah (; born Mohammad Mirza; 5 January 1808 – 5 September 1848) was the third Qajar shah of Iran from 1834 to 1848, having succeeded his grandfather Fath-Ali Shah. From a young age, Mohammad Mirza was under the tutelage of Haji Mirza Aqasi, a local dervish from Tabriz whose teachings influenced the young prince to become a Sufi-king later in his life. After his father Abbas Mirza died in 1833, Mohammad Mirza became the Crown Prince of Iran and was conferred the title of Governor of Azarbaijan. Not long after, Fath-Ali Shah died on his way to Shiraz, leading some of his sons—including Ali Shah Mirza and Hossein Ali Mirza—to revolt but Mohammad Shah, with the support of his grand vizier, Abol-Qasem Qa'em-Maqam, suppressed the rebellions and asserted his authority. Mohammad Shah ordered the removal, imprisonment and eventual execution of Qa'em-Maqam, which led to appointment of Aqasi as the grand vizier. One of Mohammad Shah's main goals was to reconquer the rebellious city of Herat and return it to Iranian sovereignty. In 1837, when he had asserted his authority, he marched to Herat and laid a futile siege on the city but was forced to withdraw when the British government threatened military action. On his return to Iran, Mohammad suppressed a revolt in Isfahan led by major clergy figure Mohammad Bagher Shafti. In 1837, the Governor of Baghdad sacked the city of Khorramshahr. Mohammad Shah intended to declare war with the Ottoman Empire but the British-Russian mediation prevented escalation of tensions and war, and led to the signing of the Second Treaty of Erzurum. Under pressure from the UK, Mohammad Shah abolished the slave trade through the Persian Gulf but it was still allowed to have slaves and trade them over land. Mohammad initially opposed the abolition citing Islamic tradition but eventually accepted. Another important event of his time was the rise of the Báb and Bábism, in which Mohammad refused to kill his followers despite a fatwa imposed by Shiite clerics. France–Iran relations resumed during his reign. Mohammad suffered from gout, which overshadowed his reign, in the final years of which, his physical health deteriorated, and he died from a combination of gout and erysipelas on 4 September 1848 at the age of 40 and after fourteen years of rule. He was buried in Fatima Masumeh Shrine in Qom and was succeeded by his son, Naser al-Din Shah.