The following morning, seeing that Mahmud and Kamran had fled, chaos erupted in the camp, and taking advantage of this, Qaizar had marched out, and routed the Persian army from besieging Herat.
[6] His government was weak, however, he was dependent on the powerful Qara'i chieftain of Turbat-i Heydarieh, Ishaq Khan, to keep his rule stable.
The Herati-Iranian wars of 1804, 1807, and 1811 were fought over the strategic border fort of Ghourian, as the Qara'i chieftains sought to use the rivalry between Mashhad and Herat to their own advantage.
[15] Since the governor of Ghourian, Sardar Mohammad Khan Qara'i, had no hope of aid from Iran, he requested help from Shah Mahmud to defeat Firuz al-Din Mirza.
As a result, Firuz al-Din withdrew from Ghourian and requested aid from the Qajar general Isma'il Khan Damghani, promising to pay 50,000 tuman and have the khutbah read in the name of Fath 'Ali Shah.
[14][6] In the Summer of 1816 Ishaq Khan Qara'i and his son were strangled on the orders of Mohammad Vali Mirza due to his secret support of the Khorasani rebels.
After repreated attacked by Iranian forces, Firuz al-Din capitulated and sent 50,000 tuman in tribute as well as agreeing to read the Khutbah in the name of Fath 'Ali Shah.
[10] However, Mahmud refused to storm the citadel, instead camping outside, meaning that "all the benefit of the Badghis victory quickly dissipated"[10] and his siege of Herat failed.
[19] He imposed heavy taxes upon the populace, as he "not only bathed himself in luxury, but he also built up a large war chest to meet any threat to his power from Iran or from Kabul.
The local chieftains (mainly of the Qara'i and Za'faranlu) rebelled, and were in control of Bojnord, Quchan, Nishapur, Mashhad, Serakhs, Torbat, Jam, and Bakharz.
[6] Yar Muhammad Khan Alakozai played a key role in starting the revolt that occurred after the Khorasan governor Shuja as-Sultana was recalled to Tehran in January 1827.
[5] The city was then besieged but Dost Mohammad Khan intervened on the side of the Qandahar Sardars and forced Shuja to flee to Herat with only 50 cavalry.
This action caused Kamran Shah to summon the Aimaq tribal chieftains to Herat and secured promises from them that they would cooperate against the Iranian government.
However, Sher Mohammad Khan Hazara vowed to fight to the death for him and promised Kamran safety among his tribe if Herat were to fall, therefore preventing his flight.
'Abd al-Rahman Khalifa, the Turkmen governor of Merv and the successor of Sufi Eslam's movement, played a key role in reviving the confederacy.
[14][6][23] As Champagne mentions in his dissertation, "Kamran Mirza very clearly saw that in order to maintain the independence of Herat and to reconquer his father's throne in Kabul, it would be necessary to neutralize any threat from Iran by asking for the assistance of the Qajar court.
Yar Mohammad Khan, when taking the throne, notably didn't proclaim himself a king but instead took the title of "Vizier-i Kabir",[5] or the "Great Vizier".
[10][23] When Hukumat Khan heard of this, he quickly rushed to tender his submission and provided the army with supplies, preventing the Heratis from sacking other regions of Maimana.
[10] In 1849 and 1850, the Barakzais had already incorporated significant parts of Afghan Turkestan into their kingdom, and if all of the region was to fall then Herat could be simultaneously attacked from Maimana and Qandahar.
[10] Owing to lack of British knowledge on the area, Yar Mohammad was able to convince them into supporting the extension of Herat's frontiers as far as Balkh, although he failed in making that objective a reality.
[6] The Qandahar Sardars conquered Lash-Joveyn and Chakansur[8] (ruled by the independent Sanjarani Baloch tribe, which also controlled Khash Rud and Rudbar.
[6][5] When the invasion was crushed, Sa'id Mohammad Khan pressured the Iranian forces to leave the country, but not before he agreed to make coins and have the Khutbah read in the Shah's name.
Notably, Hashim and Karimdad Khan Alakozai were brutally killed on his orders (the first one by being beaten with sticks on his belly until it burst, the second by having boiling oil placed on a crown of dough on his head.
An envoy from Qandahar arrived, promising not to interfere in Herat and give back the city of Farah if Sa'id Mohammad Khan would cut ties with his Iranian backers.
The Hazaras wrote a letter to Mohammad Yusuf bin Malik Qasim Mirza to take his place as the rightful ruler of Herat.
Under Sa'id Mohammad Khan there was an incident where the troops refused to wear their new Austrian uniforms shipped in from Tehran and didn't want to shave their beards.
Both Kamran Shah Sadozai and Yar Mohammad Khan appointed their relatives as governors to peripheral regions, and they aren't considered as velayat.
The French scholar Louis Massignon was able to say that Herat's bazaars were the center of the city's "economic, social, political, administrative, and religious" life.
[5] Stack lists silk, saffron, assafetida, pistachios, almonds, dried fruit, gold and silverwork, swords, cutlery, carpets, glassware, and metalwork as products sold in Herat.
[36][19] In 1845, French visitor Joseph-Pierre Ferrier reported that the Hindu merchants controlled most of the trade with India and farmed taxes in service of Yar Mohammad Khan.