Khan restarted war with the Sikhs in Kashmir as well. Dost Mohammad Khan, believing that deposing Shah Mahmud was more important, had marched on Kabul with a small force of Qizilbash While Azim Khan kept most of his army at Peshawar to continue war with the Sikhs. Shah Mahmud, having heard that Dost Mohammad was marching to Kabul, left Kandahar to defend his capital from the Barakzais. However, when he had reached Ghazni, news came that Kandahar fell to Sher Dil Khan. Seeing himself being slowly surrounded, Mahmud remained in Ghazni. Shah Mahmud sent Kamran's son, Jahangir Mirza, alongside 'Ata Mohammad Khan to Kabul. Unbeknownst to him was that 'Ata Khan was in contact with Dost Mohammad Khan, who offered to change sides on the condition that all of Payendah Khan's sons swear an oath on the Quran to not put him the death for putting out Fateh Khan's eyes. Dost Mohammad Khan sent him the oaths. 'Ata Khan had then left the Bala Hissar on the context of attacking the enemy lines, he then defected. However when he arrived to where Dost Mohammad Khan was alongside his camp, his eyes were gouged out with a dagger by Pir Mohammad Khan, the youngest of the Peshawar Sardars who did not sign the Oath. Dost Mohammad Khan then occupied the lower Bala Hissar, Jahangir had then escaped to Ghazni. Realizing the situation was not to his favour, Shah Mahmud had fled with his royal retainers and his family through fled to Herat through the Hazarajat. Ending Shah Mahmud's second reign. Rule in Herat Restored Reign, Infighting, and Iranian Invasion (1819–1823) After the Barakzais expelled him from Qandahar in 1818, Mahmud Shah fled to Farah and then to Herat. Reportedly, he reached Herat with only 11 men under his command. Mahmud Shah, when reaching Herat, turned over its administration to his son Kamran, who also consulted him on political matters. Ata Mohammad Khan Alakozai also became the vazir of Herat. In 1819, Saleh Khan, a noble who gained favour with Kamran, tried to convince him to reconquer Qandahar. However, Kamran said he didn't have enough money and blamed Saleh Khan for his past troubles. Mahmud and Kamran Shah both united to extort Saleh Khan, and in response Saleh Khan secretly sent a letter to Firuz al-Din Mirza (the previous ruler of Herat who was in exile in Mashhad), and invited him to