as a result when Shah Mahmud and Fateh Khan were campaigning, followers of Khwaja Khanji, Sayyid 'Ata, and Sayyid Ashraf had rebelled and placed Abbas Mirza, another son of Timur Shah Durrani on the Durrani throne. The Qizilbash in Shah Mahmud's army mutinied when they heard of this coup, and returned to Kabul. Seeing their kingdom under threat, Shah Mahmud and Fateh Khan had to break off their campaigns against the Sikhs and had to return to Peshawar to mobilize a force to march to Kabul. Shah Mahmud sent them quickly to Kabul, where he had fought multiple skirmishes outside the capital, Shah Mahmud had emerged victorious and had defeated the rebellion against him. the ringleaders were captured and sentenced to death by execution by being crushed by an elephant. Khwaja Khanji escaped execution and fled to Kohistan. Fateh Khan's half-brother, Dost Mohammad Khan with a corps of Qizilbash to wipe out the remaining rebel pockets, and had laid waste to much of lands around Kohistan, burning crops and orchards. When Khwaja had still refused to submit, Dost used a sign of flattery, promising to pardon him and open a royal marriage, having lured Khwaja, Dost had beheaded Khwaja and other leaders of the movement. Khwaja's two sons had however, escaped this. Confrontations with Persia In 1816, Firoz-Al-Din had revolted, capitalizing on Persia's weakened state after the Treaty of Gulistan. Firoz had occupied Ghurian, however, Fath-Ali Shah Qajar had marched out to meet him, and had regained control of Ghurian and forced Herat to recognize Persian Suzerainty. In 1818, Firoz had revolted again when Fath-Ali had demanded more tribute, Firoz would appeal to Shah Mahmud for assistance. Wazir Fateh Khan, seeing an opportunity to expand his power base more and continue the Barakzai monopoly over the Durrani Empire, had accepted Firoz's offer and marched to Herat with a raised army of 15,000. Also accompanied by Dost Mohammad Khan and the Dil brothers. Fateh had tricked Firoz into letting him and a contingent of soldiers to enter the city, where Fateh Khan had then ordered the arresting of Firoz, and the execution of many high officials. The city gates were opened, and Herat was sacked, with mass killings, and rapings in ordination from this. In a twist of events, one of Shah Mahmud's daughters were among the ones raped. Once order was re-established, Shah Mahmud's daughter sent a letter to Shah