of the country. Nevertheless, Soltan Hosayn continued to use the majority of his time and funds on construction projects. Mahmud and his army swept westward aiming at the shah's capital of Isfahan itself. Rather than biding his time within the city and resisting a siege in which the small Afghan army was unlikely to succeed, Soltan Hoseyn marched out to meet Mahmud's force at Golnabad. Here, on 8 March, the royal army was thoroughly routed and fled back to Isfahan in disarray. The shah was urged to escape to the provinces to raise more troops but he decided to remain in the capital which was now encircled by the Afghans. Mahmud's siege of Isfahan lasted from March to October, 1722. Lacking artillery, he was forced to resort to a long blockade in the hope of starving the Iranians into submission. Soltan Hoseyn's command during the siege displayed his customary lack of decisiveness and the loyalty of his provincial governors wavered in the face of such incompetence. Protests against his rule also broke out within Isfahan and the shah's son, Tahmasp, was eventually elevated to the role of co-ruler. In June, Tahmasp managed to escape from the city in a bid to raise a relief force in the provinces, but little came of this plan. Starvation and disease finally forced Isfahan into submission (it is estimated that 80,000 of its inhabitants died during the siege). On 23 October, Soltan Hoseyn abdicated and acknowledged Mahmud as the new shah of Iran. Captivity and death Mahmud initially treated Soltan Hoseyn considerately, but as he gradually became mentally unbalanced he began to view the former shah with suspicion. In February 1725, believing a rumour that one of Soltan Hoseyn's sons, Safi Mirza, had escaped, Mahmud ordered the execution of all the other Safavid princes who were in his hands, with the exception of Soltan Hoseyn himself. When Soltan Hoseyn tried to stop the massacre, he was wounded, but his action saved the lives of two of his young children. Mahmud succumbed to insanity and died on 25 April of the same year. Mahmud's successor Ashraf Khan at first treated the deposed shah with sympathy. In return, Soltan Hoseyn gave him the hand of one of his daughters in marriage, a move which would have increased Ashraf's legitimacy in the eyes of his Iranian subjects. However, Ashraf was involved in a war with the Ottoman