Herat (1793–1863)
The Principality of Herat (Persian: شاهزاده‌نشین هرات), the Emirate of Herat (Persian: امارت هرات), the Herat Khanate (Persian: خانات هرات) or simply Herat (Persian: هرات) was a state in Afghanistan from 1793 to 1863, and one of the 3 main khanates in 19th century Afghanistan (the others being the Khanates of Kabul and Qandahar). In 1793, Timur Shah Durrani died and Mahmud Shah took control of Herat, becoming independent. In 1801, the principality was revived by Firuz al-Din Mirza. Herat was prosperous under his reign in spite of multiple Iranian invasions. In 1818, Mahmud and later Kamran Shah took over, attempting to keep the region stable as a buffer between the Barakzais and Qajars. However, the region was devastated by constant infighting and Iranian invasions. The Iranian invasion of 1837 weakened the principality, eventually allowing Yar Mohammad Khan Alakozai to overthrow the last ruler, Kamran Shah Durrani, in 1842, and expand the principality's borders towards the Chahar Wilayat, Aimaq territory, and Lash-Joveyn. With his death in 1851 the principality began to decline due to a series of incompetent rulers as well as a civil war and an Iranian invasion in 1856. The weakening of the principality allowed the Barakzais to intervene and besiege Herat. Ultimately they were able to capture the city on May 27, 1863, ending Herat's existence as an independent state. History

First Reign of Mahmud Shah Durrani (1793–1801)

Death of Timur Shah 
When Timur Shah died on May 18 or May 21, 1793, Afghanistan fell into civil war. Timur Shah had 25 sons. 5 of those would become contenders for power in the following years. Zaman Shah was to be the successor of Timur Shah and was crowned on May 23. However, two of Zaman Shah's relatives would oppose his ascension to the throne. Humayun Mirza (the governor of Qandahar) opposed Zaman Shah's claim to the throne and rebelled upon receiving news of Timur Shah's death. In addition to this, Mahmud Mirza rebelled in Herat and minted coins in the name of the dead Timur Shah. On June 19, Zaman Shah marched out of Kabul headed for Qandahar. He soon captured Qandahar and forced Humayun Mirza to flee to Baluchistan. First Attempt at Gaining Qandahar (1795) 
Zaman Shah, seeing Mahmud as a future threat if the Persians had ever invaded again, had decided to try and retake Herat and strip Mahmud of his administrative titles. Zaman Shah had met Mahmud Shah at a battle near Girishk. Zaman Shah defeated Mahmud Shah and this allowed him to besiege Herat. The city however, held out. Eventually, Mahmud Shah's mother had broken a deal between the two brothers. The terms of which would be Zaman Shah being recognized as King of the Durrani Empire in exchange for keeping his governorship of Herat. However, nobody had seemed to give notice to Mahmud's son, Kamran Mirza. Kamran, noticing Zaman Shah leaving back to Helmand, had led his armies in pursuit, and once he had left, Qilij Khan, the governor of Herat in place for Kamran while he was on his campaign had led a rebellion and opened the gates to Zaman Shah. Mahmud and Kamran then fled to Tehran. Second Attempt at Gaining Qandahar and Exile (1797–98) 
During Zaman Shah's campaigns in Punjab against the Sikhs, the British had seen this as a threat, where Zaman Shah could align the Muslim powers of India against the British in a coalition, as a result, the British had given 10,000 rupees to the Shah of Persia. Seeing opportunity, Mahmud Shah, along with his brother, Firoz Mirza, had mobilized and marched on Farah and Herat. Instead of the Shah joining directly, he supported Mahmud and Firoz. The two princes captured Farah, and also defeated Qaizar Mirza, Zaman Shah's son, and also besieged Herat. Zaman Shah had abandoned his Punjab campaign and pulled back to Peshawar, the Sikhs recaptured Lahore as a result of this. Despite Herat in large support of Mahmud Shah, Qaizar had held out. In an attempt to undermine the Persian alliance, Qaizar's Wazir had sent a letter to Mahmud Shah's ally, Mir Ali, and had offered to assassinate Mahmud Shah. However Mahmud's spies intercepted this message, Mahmud Shah and Kamran were completely deceived, and fled in the dead of the night. 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. Following this victory, Zaman Shah had returned to Punjab, recapturing Lahore and also placed Ranjit Singh, as an attempt to divide the Sikhs as the nawab of Lahore, and Zaman had returned to Peshawar. Reign of Hajji Firuz al-Din Mirza (1801–1818)

Ascension to the Throne and Early Challenges (1801–1804) 
With Mahmud Mirza's restoration to the throne on 25 July 1801, Hajji Firuz al-Din Mirza was appointed the governor of Herat. However, due to the internal conflicts in Afghanistan at the time, he became effectively independent. The Qajars had conquered Khorasan relatively recently from Nader Mirza Afshar and other independent Khorasani chieftains. On December 24, 1803, Mashhad fell to Qajar's troops and the 15 year old Mohammad Vali Mirza was appointed governor. His government was weak, however, he was dependent on the powerful Qara'i chieftain of Turbat-i Heydarieh, Ishaq Khan, in order to keep his rule stable. Ishaq was easily able to take advantage of this weakness to expand his dominion at the expense of his neighbors. 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. Conflict Over Ghourian (1804–1813) 
In December 1804, Ishaq Khan Qara'i seized Ghourian from Firuz al-Din Mirza. He appointed his nephew Yusuf 'Ali Khan Qara'i as governor. He was able to exert his influence in the regions of Jam and Bakharz and in a crucial location to get involved in matters with Herat. In 1807, Yusuf 'Ali Khan defected to Hajji Firuz al-Din Mirza and abandoned the Qara'i chieftain. He had been encouraging Firuz al-Din Mirza to conquer Khorasan for some time. Therefore, the Vali of Khorasan, Mohammad Vali Mirza, marched with an army to recapture Khorasan in the spring of 1807. Iranian sources blame the preacher Sufi Eslam and other Afghan mullahs for instigating Firuz al-Din to declare war on the Iranians, for Firuz al-Din's advisors were against fighting with Iran. When Firuz al-Din heard of the approach of the Iranian troops, his support for war faded and his general Badal Khan Afghan preferred submitting to the Iranian government. However, in the end, Firuz sided with Sufi Eslam's war party (composed of Afghan and Aimaq chieftains). Firuz managed to obtain a fatwa that declared the war against Iran as a jihad. Sufi Eslam called upon 50,000 infantry and cavalry to oppose the Iranian advance. Thousands of Aimaqs, Uzbeks, and Turkmens joined his army to fight the holy war against the Iranians. Sufi Eslam was given command of the army. Reportedly, Sufi Eslam was placed in a golden howdah with 366 bodyguards (corresponding to the days in a year) around him. The Iranian army was composed of 14,000 infantry and cavalry with 12 pieces of artillery. The Qajar army encamped at the village of Shahdih, led by Mohammad Khan Qara'i. On May 19, May 30, June, or June 29, 1807, the Herati army reached the Rubat Charkah field and attacked the Qajars, beginning the battle of Shahdih. The Herati army was annihalated (with between 3,800 and 6,000 Afghan troops killed) and Sufi Eslam was beheaded by a cannonball. The Iranians then besieged Herat for 40 days before Firuz al-Din capitulated and sent 3 years of taxes to the Iranian government. In 1811, Firuz al-Din Mirza refused to pay his annual tribute to Iran. As a result, in July 1811 Mohammad Vali Mirza marched from Bakharz to Ghourian, and from there to Pul-i Nuqrah. He gave the order to sack the surrounding area, forcing Firuz al-Din to come to peace terms. He paid his taxes to the Iranian government and promised to pay his yearly tribute. In addition to this Firuz sent his son, Malik Husayn Mirza, as a hostage. Khorasan Rebellion and War with Iran (1813–1818) 
In the summer of 1813 relations between Mohammad Vali Mirza, the governor of Khorasan, and the Khorasani tribal chieftains worsened. Eventually, the khans held a conference on the Turkmen steppe where they decided to revolt and depose Mohammad Vali Mirza. On August 25, 1813, Ishaq Khan Qara'i and his forces sacked the royal stables at Chenaran, beginning what would be a 5 year long revolt. The Qara'i Turks, Za'faranlu Kurds, the Aimaq Hazaras of Bakharz and Jam, and other tribal groups participated in the revolt. In 1814, Firuz al-Din took advantage of the chaos in Khorasan to renew his designs on Ghourian at the urging of Ebrahim Khan Ilkhani Hazara. Firuz's son, Malik Qasim Manda, marched to Ghourian with a large army and besieged it. 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. Mahmud sent his son and governor of Qandahar, Kamran Mirza, with a large army to attack Herat. Kamran Mirza surrounded Herat and set up camp in the village of Ruzah Bagh. 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. As a result, when Qajar troops approached Herat and attacked Kamran Mirza's troops, he did not even attempt a defense and retreated back to Qandahar. Firuz al-Din then fulfilled his promise and paid Isma'il Khan Damghani 50,000 tuman. 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. As a result, this made his situation worse and as stated by Riyazi: "In the year 1231 A.H, equivalent to 1815 A.D., due to the killing of the late Sardar Muhammad Ishaq Khan Qara'i and Hasan 'Isa Khan, his son, the state of affairs in Khurasan and its frontiers became chaotic. The tribal chiefs and leaders of the inhabitants of each locality and clan revolted." Firuz al-Din used the revolt as an opportunity to seize Ghourian. Mohammad Khan Qajar was defeated by an alliance between Mohammad Khan Qara'i and Bunyad Khan Hazara and fled to Mashhad. Bunyad Khan Hazara then raided the city's suburbs. When Fath 'Ali Shah heard of the loss of Ghourian, he recalled Mohammad Vali Mirza and appointed Hasan 'Ali Mirza "Shuja al-Saltana" as governor, sending 10,000 men with him to put Khorasan back in order. On April 4, 1817, Hasan 'Ali Mirza marched towards Herat with the support of the Za'faranlu and Qara'i tribes. The Qajar army marched through the district of Jam and took the fort of Mahmudabad. A day later Jam was occupied and the Qajars killed so many Hazaras that they were able to create a tower of skulls. Hasan 'Ali Mirza then marched towards Ghourian and then reached the village of Shakiban and set camp at Pul-i Nuqrah. Firuz al-Din's troops and some Afghan sipahis set up earthworks outside the Citadel of Herat and prepared to defend the city. Hasan 'Ali Mirza ordered half of the army to attack and the other half to set up earthworks behind the Injil River. 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. The prince then marched into the territory of the Aimaq tribes, to punish the Aimaq Hazaras for hosting Bunyad Khan as a refugee from Iranian troops. However, in the summer of 1817 they were defeated at Darra-yi Bum and forced to retreat. Fateh Khan's rule and deposition of Shah Mahmud (April 1818–Late 1818) 

Firuz al-Din requested aid against the Iranian invasion. As a result, Fateh Khan Barakzai took the opportunity to conquer Herat. At the end of April 1818 he entered Herat and deposed Firuz al-Din Shah. He sent his half brother Kohandil Khan towards Ghourian and made alliances with Khiva and the Qara'is and the Hazaras of the province. Second Reign of Mahmud Shah Durrani (1818–1829)

Restored Reign and Disputes with Saleh Khan and Kamran Sadozai (1818-1821) 
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 Kamran Mirza, 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 claim the throne. Together they both marched on Farah, a city in the south controlled by a supporter of Kamran, and captured it. Saleh Khan was able to make a compromise where he would control Farah and Firuz al-Din Mirza would return into exile in Mashhad. Iranian Invasions and Revolt of Mustafa Khan Zori (1821-1823) 
Ever since 1816, Herat had refused to pay tribute to Persia. Kamran Mirza made multiple excuses on why he wasn't able to pay. In addition to that, Herat had actively supported the revolt of Banyad Khan Hazara (the Hazara chieftain of Jam and Bakharz). On June 25, 1821, a Qajar force of 3,000 shattered Banyad Khan's Jamshidi, Hazara, and Firozkohi troops at the battle of Kariz. He was pursued into the lands of the Chahar Aimaq. In 1822, Iranian forces invaded Herat and besieged the city, aiming to restore Firuz al-Din to the throne. In the process, Ibrahim Khan Jamshidi, Khalil Khan Taymani, and Qilich Khan Timuri (one of the leaders on the Iranian side and the autonomous governor of Khvaf) were killed during a battle on May 22. In the end, Herat withstood the siege by Iranian forces. However, although the Qajar troops had ravaged the province dearly it doesn't seem to have much of an effect on Kamran, as within a year or two he was to attack Qandahar. In the Islamic year 1238 (equivalent to October 1822 to September 1823) or 1824, Kamran Mirza attempted to conquer Qandahar, leaving the administration of Herat in the hands of Husain Khan and Mustafa Khan Zori. However, while Kamran was on route to Qandahar, allies of Firuz al-Din placed him back on the throne. However, Mahmud was soon able to convince them to desert Firuz and install him instead, thus ending Firuz al-Din's 18 day rule. Firuz al-Din Mirza would flee to the city of Torshiz after being deposed. In the Islamic year 1247 A.H. (June 12, 1831 - May 30, 1832), he would be assassinated at the instigation of Kamran Shah. When Kamran Shah returned from Qandahar, Mahmud refused to let him back in. As a result, Kamran, with the support of the Qandahar Sardars, besieged Herat. Mahmud then recruited the help of Saleh Khan, who sent Mustafa Khan Zori to break the siege of the city. They were successful, but Mustafa Khan then turned against his allies, imprisoned Saleh Khan, and forced Mahmud Shah out the city. However, Kamran and Mahmud Shah then united against Mustafa Khan and within a month deposed him. In the winter of 1824 Mustafa Khan was executed. Kamran Mirza put a paper hat on Mustafa Khan's head and then poured lamp oil on top of it. In the Islamic year 1240 (August 1824 to August 1825), Mahmud Shah marched into Jamshidi lands and occupied Bala Murghab. Civil War in Herat and final victory of Kamran Shah (1823–1829) 
After Mustafa Khan's death, Mahmud Shah and Kamran Shah immediately started fighting each other for control. Mahmud fled to Khwaja Ansari's tomb at Gazurgah, and then 6 months later fled across the Murghab to seek the aid of the Jamshidi tribes. Kamran Shah needed help, so he requested the aid of Iran. In July 1826 Hasan Ali Mirza Qajar sent 6,000 or 10,000 men with 4 guns to the aid of Kamran Shah. When they reached Herat on July 16, 1826, they combined with 2,000 of Kamran's troops and marched towards the Murghab. However, spies leaked Kamran's plans to Mahmud, who set up an ambush. The Aimaqs and Uzbeks completely routed the Iranians, and Mahmud marched onward to Herat. However, Mahmud refused to storm the citadel, instead camping outside, meaning that "all the benefit of the Badghis victory quickly dissipated" and his siege of Herat failed. Mahmud fled to the Hazaras of Qala-e Naw but Kamran sent an army after him. The Herati army starved the Hazaras of supplies and forced them to hand over Mahmud. However, he fled to Lash-Juwain rather than being taken prisoner. In 1827 Kamran took pity on Mahmud and invited him back to Herat. In 1828-29 Ata Mohammad Khan Alakozai died. His son Sardar Din Mohammad Khan Alakozai then succeeded him as vazir. However, due to the courtiers being against this appointment, he was forced to give up the viziership to his 40 year old cousin, Yar Mohammad Khan Alakozai. The first act Yar Mohammad Khan did in 1829 was to depose Mahmud Shah, who died shortly after. Kamran then became the ruler. Reign of Kamran Shah (1829–1842) 
Kamran Shah was initially a generous ruler when he first came to Herat. He spent time into ruling his kingdom in his early years. But after fighting with multiple contenders to gain the throne, his personality changed and he became more demanding. Kamran was well known for his greed, and became obsessed on obtaining more and more wealth. 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." He developed a variety of ways to extract wealth that included at least 4 different methods of torture. As Kamran got older, he spent more and more time chasing pleasure. He would use his power to embark on numerous sexual adventures involving both boys and girls, as well as drinking copious amounts of alcohol. However, the populace still preferred him rather than be under the suzerainty of the Barakzais, as they were even more despotic. Kamran was in a power struggle with his Vizier, Yar Mohammad Khan Alakozai. His attempts at usurping Kamran's throne were only prevented due to the efforts of Sher Mohammad Khan Hazara (the chieftain of the Qala e Naw Hazaras) was unquestionably loyal to Kamran Shah and had prevented Yar Mohammad Khan from overthrowing him. As a result, he was granted the title of Nizam al-Daula (نظام الدوله). In addition to this, the British also supported Kamran Shah as an attempt to prevent the Iranians from conquering the region. Involvement in the Second Khorasan Rebellion and Persian Invasion (1829–1833) 

Herat supported a rebellion in Qajar Khorasan at the time. 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. Yar Mohammad 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. In 1830 he led a 6,000 man army into Khorasan and terrorized the population. However, he eventually retreated back to Herat seeing that any minor incident could be used by Iran as a causus belli to reconquer the state. When in December 1831 'Abbas Mirza arrived, he quickly worked to crush the revolt. In the summer and fall of 1832 the Qara'i and Zafaranlu chieftains were forced to submit and then he moved against Herat. When the vizier returned, Kamran Shah again prepared for an attack on Qandahar and collected funds from Herati merchants. In early 1833 'Abbas Mirza sent an ultimatum to Kamran Shah  "that he should give up Herat and present himself at the Qājār court or perform sikka and khuṭba in the name of the Iranian king, submit taxes (manāl-i dīvān) and give hostages." Yar Mohammad Khan refused the ultimatum and 'Abbas Mirza responded by placing him under arrest. 'Abbas Mirza forced Yar Mohammad Khan to agree to his demands by taking out two of Yar Mohammad's teeth, at which point he was allowed to return to Herat after paying a ransom and a hostage exchange. However, Kamran Shah refused the ultimatum, gave 'Abbas Mirza a present of 15,000 tuman, and asked him to prepare for war if he wanted to demand any more. As a response, 'Abbas Mirza sent his son, Mohammad Mirza, with 27,000 or 30,000 troops to attack Herat in the summer of 1833. Qa'im Maqam was sent with 4,000 troops as a reinforcement. Kamran Shah only had around 5,000 men at his disposal. Sher Mohammad Khan Hazara organized a confederacy of Aimaq, Uzbek, and Turkmen tribes to defend Herat against the Shi'ites. He managed to convince Mizrab Khan of Maimana to overcome his suspicion of Yar Mohammad Khan and join the confederacy in fighting against the Iranians. Mohammad Mirza took Kohsan and attempted to besiege the fort of Ghourian. This siege was unsuccessful however, and Qa'im Maqam left 2,000 troops at Ghoruian to continue the siege while he and Mohammad Mirza moved towards Herat. Although it was doubtful that the army could take Herat since it couldn't even take Ghourian, the answer to that was never resolved since 'Abbas Mirza ended up dying from tuberculosis on October 25. Mohammad Mirza, as the heir-apparent, was abliged to lift the siege. However, "Muhammad Mirza vowed that, once he had secured the throne of Persia, he would return and avenge himself on the city that had the timerity to resist his army." He demanded that Kamran Shah pay tribute and demolish the fort of Ghourian. Although Kamran Shah did accept these demands, he never followed through with them. Intervention in Sistan and Persian Siege of Herat (1834–1838) 
In January 1834 Shuja ul-Mulk marched against Qandahar with 22,000 men. 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. Kamran was suspicious of his intentions and refused to let him enter the city, for he was a potential rival for the throne. However, Mohammad Mirza hadn't forgotten his promise once he took the throne as Mohammad Shah Qajar in 1834. He began preparations to build an army to conquer Herat during the spring of 1836. However, a cholera epidemic in Khorasan forced Mohammad Shah to postpone his plans. He instead made a campaign towards the Turkmen tribes in the vicinity of Astarabad. 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. While Iran was planning to conquer Herat once and for all, troops under Yar Mohammad Khan subdued the Sistan region, disputed between the Qandahar Sardars and Iran. As a result, relations with Iran worsened further. On July 23, 1837, Mohammad Shah marched out of Tehran towards Herat. According to Mohammad Yusuf, the army consisted of 80,000 infantry and cavalry as well as 40 artillery pieces led by Habibullah Khan Shahsevan. They coalesced at the city of Torbat-e Jam on October 28, 1837. They planned a four-pronged attack, with some marching on Herat in 3 different columns, while some troops would march into Maimana and neutralize the tribes in the area. The situation in Herat was favourable to the Iranians. Kamran and Yar Mohammad both terrorized the population and pushed the area into an economic decline, and as a result many people left the city. 10,000 Aimaq families fled to the Maimana Khanate, only to be put into slavery by Mizrab Khan. Herat's fortifications were seriously damaged by years of war, and wouldn't survive a serious assault. The few thousand troops Herat did have were badly equipped. Because of this, Kamran Shah was planning to flee as soon as the Iranians invaded. 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. He attempted to revive the tribal confederacy that defended Herat against the Iranians in 1833. '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. After a brief siege, Ghurian fell on November 15, 1837. The siege began on November 23, 1837, Mohammad Shah arrived before Herat. His intention was to take Herat then move on to Kandahar. With him was the Russian Envoy Count Simonich, seconded Russian officers and a regiment of Russian deserters under the Polish general Berowski. Pottinger stiffened the defences of Herat and despite the presence of the Russian advisers the siege lasted eight months. Fighting was barbaric. Yar Mohammed paid for Persian heads, which were displayed on the ramparts. Pottinger thought this counter-productive since soldiers would stop to cut off heads rather than pursue the enemy. Around the New Year the Persians brought up a huge 8-inch cannon which fired half a dozen times and then collapsed. By January the Iranian force reached 40,000 men, but the ring around the city was not complete. Fighting dragged on into the spring and early summer with neither side gaining an advantage. In April 1838 both John McNeill (a British diplomat) and Count Simonich (a Russian adviser) arrived at the Shah's camp and worked at cross purposes. At one point McNeill threatened the Shah with war if Herat were taken. He persuaded the Shah to cancel a planned assault, doing this deliberately to reduce the morale of the Iranian troops. By March or April 1838 Saint Petersburg had become concerned of a possible British reaction and decided to recall Simonich, but communications were so slow that the message did not reach Herat until June. McNeill reported that the Iranian troops were suffering and that the siege would have to be abandoned if the supply situation did not improve. The besieged were also in difficulties. At one point 600 elderly men, women and children were driven out of the city to save food. They were fired on by both sides until the Iranians let them pass. By June 7, 1838, Count Simonich had gained such influence with the Shah that McNeill felt forced to return to Teheran. Simonich cast aside his diplomatic role and took over management of the siege. When Simonich received word of his recall on June 22, his response was to order an immediate assault on the city. On June 24, 1838, the Iranians attacked at five points but they only managed to breach the wall at the southeast corner. Fighting ebbed back and forth for an hour. According to Kaye both Pottinger and Yar Mohammed were at the breach encouraging the troops. When Yar Mohammed began to lose courage Pottinger physically drove him forward. Yar Mohammed then rushed like a madman to the hindmost troops and the whole body poured out of the breach and drove the Iranians away from the wall. Meanwhile, the British government took action. Realising the impracticality of sending a force across Afghanistan they sent a naval expedition to the Persian Gulf and on June 19, 1838, occupied Kharg Island. McNeill, who had returned to Teheran, sent Charles Stoddart to the Iranian camp with a threatening message (August 11, 1838). The Shah backed down and on September 9 the siege was lifted. Under British pressure the Russians recalled both Count Simonich and Yan Vitkevich claiming that both had exceeded their instructions. Aftermath of the Siege of Herat and Deposition by Yar Mohammad Khan Alakozai (September 1838–March 1842) 
On 31 March 1841 Iranian forces withdrew from Ghourian. Tensions between Kamran Shah and Yar Mohammad Khan became tense. Kamran was jealous of Yar Mohammad Khan's power and both tried to find an excuse to eliminate the other and gain control. In 1841, Kamran entered the citadel of Herat and started a rebellion against Yar Mohammad Khan. However, Kamran Shah was eventually defeated and was placed under surveillance in Kohsan. In early 1842, Kamran was brutally murdered under the orders of Yar Mohammad Khan Alakozai, thus ending the Sadozai dynasty. Foreign Relations under Kamran Shah 
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. Partly because of his efforts, the Qajars did not attack Herat from 1823 to 1833." In addition to that, the Iranians also aided Kamran and was a significant factor in placing him on the throne and removing his father Mahmud. Reign of Yar Mohammad Khan Alakozai (March 1842–June 1851) 

Yar Mohammad Khan, when taking the throne, notably didn't proclaim himself a king but instead took the title of "Vizier-i Kabir", or the "Great Vizier". He was popular with the people of Herat. Policies Against the Chahar Aimaq (1842–1844) 
He pursued expansionist policies towards the traditionally independent tribes of the Chahar Aimaq. When Yar Mohammad Khan deposed and executed Kamran in early 1842, he also sent a campaign into the territory of the Jamshidi. The Jamshidi were settled along the Murghab River and controlled Panjdeh, Kushk (the capital), Bala Morghab, Marouchaq, and Karokh. When the pro-Yar Mohammad leader of the Jamshidis was assassinated, he sent a Herati army that captured Kushk. 5,000 Jamshidi families were relocated to the Herat valley but the majority of the Jamshidis managed to escape to Panjdeh and went under the protection of Khiva. He also campaigned against the Taymanis of Ghor. Yar Mohammad Khan made the two main rulers of Ghor (Mustafa Khan and Ibrahim Khan) fight against each other, and as a result was able to extend his influence in Ghor up to Karz and Nazli. In January 1843, Yar Mohammad Khan turned against Iran and made a treaty with the ruler of Bukhara, Nasrullah Khan. Herat recognized Bukharan sovereignty over Kabul, Khulm, and Balkh while Bukhara recognized Yar Mohammad's right to the Chahar Wilayat. With the backing of Bukhara, in the winter of 1843–44, Yar Mohammad forced the Hazaras of Qala-e Naw to pay tribute, although this tribute was pretty nominal. However, in April 1847, Yar Mohammad Khan attacked the Hazaras again, and this time the capital fell and 10,000 or 12,000 Hazara families were resettled in the Herat valley. Qala-e Naw lost half of its population as a result of the attack, and their chieftain Karimdad Khan Hazara fled to Iran, later joining the Revolt of Hasan Khan Salar. With the conquest of the Aimaq complete, Yar Mohammad Khan was able to pursue his expansionist policies in the Chahar Wilayat. Campaigns in the Chahar Wilayat (1844–1850) 
In 1844, Yar Mohammad Khan would get his chance to intervene in the Chahar Wilayat. Mizrab Khan of Maimana and Rustam Khan of Sheberghan mounted a joint attack on the new ruler of Andkhui, Ghazanfar Khan. Ghazanfar was overthrown and his uncle, Sufi Khan, was installed as the new ruler. Ghazanfar fled to Bukhara and agreed to pay tribute if Nasrullah Khan would restore him to the throne of Andkhui. Nasrullah agreed and sent Ghazanfar to the Mir Wali of Khulm (who was an ally of Bukhara). The Mir Wali was eager to settle old scores. Aided by the Ishans of Balkh and Mazar-i Sharif, the Mir Wali marched into the Chahar Wilayat. Sar-i Pul defected and attacked Shebarghan. Rustam Khan requested help from Mizrab Khan, however, in early 1845, Mizrab Khan died after he was poisoned by one of his wives. His two sons (Hukumat Khan and Sher Mohammad Khan) unexpectedly made peace with each other for the time being and supported Bukhara's intervention of the Chahar Wilayat. As a result, Rustam Khan received no help and Shebarghan was annexed by Sar-i Pul. Ghazanfar Khan was re-instated as the ruler of Andkhui. However, after he was placed back on the throne Ghazanfar refused to pay tribute to Bukhara. As a result, Nasrullah supported Rustam Khan in recapturing Sherbarghan and deposing Ghazanfar Khan. Once more Sufi Khan was reinstated as head of the Andkhui Khanate. At the same time as these events were occurring, the truce between Hukumat Khan and Sher Mohammad Khan broke down and they fought for the control of Maimana. Yar Mohammad Khan intervened and temporarily settled the dispute. Sher Mohammad was given control of Maimana while Hukumat Khan would control agriculture and mercantile trade, effectively becoming Sher Mohammad's diwanbegi. In addition to this, Yar Mohammad also attempted to create two Tajik battalions in the hopes that they would be more loyal to Herat. In the summer of 1847, Hukumat Khan requested assistance against Sher Mohammad Khan, becoming the pretext for war Yar Mohammad needed. Yar Mohammad marched against Maimana with 20,000 troops (half of those being composed of Aimaq and Turkmen tribesmen eager for loot). When the army reached Chichaktu (on the frontier between Herat and Maimana), it quickly fell and the town was sacked. 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. Yar Mohammad punished the looters by amputating their noses and ears even though it was quite obvious he had approved of the sacking. They soon marched on Sher Mohammad Khan's stronghold of Khairabad and the fortress was torn apart. Sher Mohammad initially fled and eventually reconciled with his brother. Ghazanfar Khan of Andkhui also requested Yar Mohammad Khan's aid in overthrowing Sufi Khan. Sufi Khan was put to death and Andkhui was subjected to a brutal sacking. Yar Mohammad intended to continue his advance to Aqcha and Balkh even though it was in the winter. He swiftly occupied Aqcha but failed to take Sheberghan and was forced to retreat to Maimana. The population refused to open their gates, so Hukumat Khan guided the army through a route going around the capital. The march back to Bala Morghab was devastating and many Herati soldiers died due to the cold or hunger. Yar Mohammad Khan returned to Herat in late February or early March 1848, and attempted to recover from the defeat. In November 1849, Yar Mohammad demanded Hukumat Khan to pay tribute to Herat. When this offer was refused, Maimana was besieged with a force of 6,000 men and the city was surrounded for 11 months. However, Maimana continued to hold out and it was detrimental to Herat's future as an independent state. 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. The siege of Maimana also helped the Barakzais because it made sure that Maimana's powerful army wouldn't come to the aid of the petty states of the region. Eventually, in September 1850, the siege of Maimana was lifted and Yar Mohammad Khan returned in defeat to Herat. Intervention in the Affairs of Khorasan and the Revolt of Hasan Khan Salar (1844-1850) 
In the late summer of 1846 Asif al-Daula planned to invade Herat and depose Yar Mohammad Khan with the support of Mohammad Yusuf bin Malik Qasim Mirza and Shah Pasand Khan of Lash and Joveyn. Foreign Relations under Yar Mohammad Khan Alakozai

Relations with Iran 
Iran also helped modernize the Herati military. The Shahs of Iran gave many presents to Yar Mohammad Khan. When the governor of Afghan Turkestan sacked Maimana in 1876, he gifted the Amir Sher Ali Khan with a Persian sword that the Iranians gave to Yar Mohammad Khan. Yar Mohammad Khan later gifted that sword to Mizrab Khan of Maimana. During the Revolt of Hasan Khan Salar, Yar Mohammad Khan intervened on the side of the Qajars, providing protection to Hamza Mirza and in return received the title of Zahir al-Daula from the Shah. In January 1850, he requested that Iran cede to him Khvaf and Jam or give him 60,000 tuman in recognition for his services in the revolt. The Qajars did neither. Relations with Britain 
Yar Mohammad obtained British support for his plans to conquer the Chahar Wilayat and Sistan. 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. Relations with Bukhara

Relations with the Qandahar Sardars

Relations with Kabul

Conquest of Lash-Joveyn and Death (1850–1851) 
The region of Lash-Joveyn was a semi-independent state that was ruled by members of the Durrani tribe and had traditionally paid tribute to Herat. With the collapse of the Sadozais the area became independent. In Safar 1267 (December 1850-January 1851) the Qajar government requested the Qandahar Sardars to invade Lash-Joveyn in order to provide security to the area. The Qandahar Sardars conquered Lash-Joveyn and Chakansur (ruled by the independent Sanjarani Baloch tribe, which also controlled Khash Rud and Rudbar.) They also planned to conquer Herat and sent troops to Gereshk for that purpose. In early 1851, Yar Mohammad Khan as a result invaded Lash-Joveyn with 2,500 infantry, 4,000 Aimaq cavalry, and 5 cannons. (British reports suggest 10,000 troops in total). They defeated the Sardar of Lash-Joveyn, Ahmad Khan Lashi, and besieged the fort of Lash for around a month. The defenders eventually surrendered the fort and Ahmad Khan Lashi fled. As a result, Yar Mohammad Khan was able to reconquer Lash-Joveyn in addition to the lands of the Sanjarani tribe. However he got sick from a dish of cucumbers and sour milk and was forced to retreat back to Herat by way of Sabzawar. Yar Mohammad Khan's sickness only got worse and when he reached Ribat-i Mir he died (either on 7 June 1851, 11 June 1851, or 29 June 1851), allowing Lash-Joveyn to secede. Twelve days after Yar Mohammad Khan's demise, his mentally unstable son, Sa'id Mohammad Khan, was put on the throne. Reign of Sa'id Mohammad Khan Alakozai (1851–1855) 
Sa'id Mohammad Khan lacked his father's leadership abilities. He relied on his Iranian mother, Nawabah, for guidance, and he had a reputation for being incompetent and weak. He didn't have the support of the Pashtuns or Hazaras of the province, and although his mother was Shi'a he had a hard time gaining the loyalty of the Tajiks and Farsiwan. The Pashtun chieftains turned to Kohandil Khan of Qandahar and Mohammad Yusuf bin Malik Qasim Mirza, a descendant of the Sadozai ruler Firuz al-Din Mirza. In the late fall of 1851 Ghulam Khan Qufaza'i (Sa'id Mohammad Khan's cousin) rebelled in the streets of Herat. The revolt was eventually crushed and the two reconciled but it showed how the Alakozai chiefs were increasingly disapproving of Sa'id Mohammad Khan's rule. In addition to Sa'id's lack of support among the population, Herat's roads were insecure and Hazara and Turkmen bandits were able to stop traffic coming to and from Herat. As a result, most caravan traffic avoided the area, wrecking Herat's economy. War with Qandahar and Intervention of Iran (1851–1852) 
In December 1851, as a response to the discontent in Herat, the Qandahar Sardars made plans to conquer Herat. In March 1852, with a 10–12,000 or 16,000-man army, they marched into Herat and within a short period of time occupied Farah (although the fort of Farah continued to resist), Lash Joveyn, and Sabzawar. Since Sa'id Mohammad Khan couldn't pay his troops due to the bad economy, it caused chaos in the Herati ranks, allowing Kohandil Khan's rapid advance. Reportedly, Kohandil Khan advanced to within  of Herat. Soon after, the city was besieged as Kohandil Khan reached the Pul-i Malan. The situation was so dire that Sa'id Mohammad Khan ordered the shopkeepers of Herat to arm themselves to defend the city. Iran, not wanting to lose its influence in Herat, intervened and sent an ultimatum to Kohandil Khan to withdraw from Farah. Kohandil Khan rejected the ultimatum and as a result, the Iranian army marched towards Herat, planning to stay for 6 months to put down opposition to Sa'id Mohammad Khan. The Iranian forces were led by the Za'faranlu Kurdish chieftain Sam Ilkhani, hoping that as Sunnis the Afghans would be less antagonistic towards the Kurds. However, many of the Heratis didn't want the Qandaharis or the Iranians to enter the city. Sam Ilkhani marched with 800 horsemen and convinced Sa'id Mohammad Khan to arrest 7 Afghan notables who were opposed to his rule. Meanwhile, another Iranian army with 10 to 12,000 troops led by 'Abbas Qoli Khan moved into Herat and approached to within 12 miles of the city, defeating Kohandil Khan on April 2 and forcing him to retreat. The Iranian army occupied Herat until the third week of May, but they stayed another three months in the province to put down any opposition to Sa'id Mohammad Khan. 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. By August 22, Mirza Aqa Khan Nuri was able to inform Justin Sheil that Iranian troops had withdrawn from Herat. In late August 1852 Iranian troops withdrew from Herat, taking several anti-Iranian Afghans with them. Increasing Discontent in Herat 
When Iranian troops left, Sa'id Mohammad Khan began purging those opposed to his rule. He arrested 22 chiefs from the Barakzai, Popalzai, and Achakzai tribes (as well as 100 from other tribes.) Even members of his own Alakozai tribe weren't spared. 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.) He confiscated the wealth of his opposition in order to pay government officials. During the Iranian rule there were conflicts between his Shi'a and Sunni supporters, one incident resulting in the death of 20 people. Since he was unpopular with many of the Sunni Afghans, he ended up siding with the Shi'a (later rulers like Sultan Ahmad Khan also derived their main support base from Shi'a and isolated their fellow Afghans.) In addition to this, when he sent a Turkman army to attack Farah in January 1853, they sold many of the locals into slavery, which decreased his support among the Sunni Afghans even more. When Iranian forces left Herat, Sa'id Mohammad Khan tried to re-assert his dominance over the Aimaq tribes in the northeast. The Hazaras and Jamshidis were loyal to the Qajar governor of Khorasan, so Sa'id Mohammad Khan tried to change that by deposing the chiefs of those tribes and replacing them with ones loyal to him. The Hazara Aimaq formed a conspiracy with Kohandil Khan and Mohammad Yusuf bin Malik Qasim Mirza to end Sa'id Mohammad Khan's rule once and for all. However, Sa'id Mohammad Khan heard about the plot and executed the Hazara chieftain Karimdad Khan Hazara, replacing him with a more loyal chieftain. This action alienated his Shi'a supporters even more, as well as increasing tensions with Iran. Foreign Relations under Sa'id Mohammad Khan Alakozai

Relations with Qandahar 
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. Sa'id Mohammad Khan refused and kicked the envoy out of the city. In the fall of 1853, Sa'id Mohammad Khan would take advantage of the war between Kohandil Khan and Dost Mohammad Khan to capture Farah, which had been under Qandahar since 1851. He sent 1,500 cavalry and 500 infantry towards the city, expelling the governor Mir Afzal Khan. Relations with Iran 
Sa'id Mohammad Khan was effectively dependent on Iran. The Iranian government sought to back up his position and shortly after the Qandahari invasion sent 3,000 military uniforms, 2,000 rifles, two cannons, standard military belts and knapsacks to beef up Herat's army. In August 1853 Sa'id Mohammad Khan made plans to recapture Farah and Qandahar, and wrote to the governor of Khorasan for approval. However, Sultan Murad Mirza refused this request, and the Qajar court was beginning to see Sa'id Mohammad Khan as a disobedient servant. Relations with Kabul

Deposition 
In the last 6 months of Sa'id Mohammad Khan's rule, the situation in Herat deteriorated. His mind became more and more unstable and during drills he would order the Arg of Herat, where his mother lived, to be bombarded. He repeatedly insulted his father and the members of his household. When people asked him what he wanted from his mother, he would reply: "I want a world from her; unless she gives it, I will not stop." For a time Sa'id Mohammad Khan's insanity was tolerable by the nobility but when Karimdad Khan was executed, the people had enough. The Hazaras wrote a letter to Mohammad Yusuf bin Malik Qasim Mirza to take his place as the rightful ruler of Herat. As a result, Mohammad Yusuf sent his brother, Mohammad Reza, to Herat. On September 15, 1855, Sartib 'Abbas Khan and some Hazaras defected to Mohammad Yusuf, starting a revolt in the city. His Alakozai tribesmen refused to help him, and the rebels besieged the citadel. The next day, Sa'id Mohammad Khan surrendered on the condition that he and his family would be spared. They were then sent as prisoners to Kohsan. However, Mohammad Yusuf broke his promise by having Sa'id Mohammad Khan executed. Two assassins (Mohammad Bayraqchi Pahlavan and Bafi 'Abbas Rayhan) went to Sa'id Mohammad Khan in the citadel and strangled him with a kerchief. His mother and two of his sisters were also killed. In addition to that, he forcibly married Sa'id Mohammad Khan's wife and mistreated her children, which worsened relations with Dost Mohammad Khan as she was the Amir's daughter. Reign of Mohammad Yusuf Sadozai, 'Isa Khan Bardurrani, and the Iranian invasion (1855–1857)

Reign of Mohammad Yusuf Sadozai (September 1855–April 1856) 
The Iranians quickly intervened and launched an invasion of Herat. In February 1856, Iranian forces under Sam Khan Ilkhani entered Herat. In March 1856 Iran captured Ghourian. In desperation, Mohammad Yusuf hoisted the British flag and declared himself a subject of Britain. April 28, 1856, Mohammad Yusuf's vizier, 'Isa Khan Bardurrani, gave him to the Iranian camp. On September 30, 1856, he was put in prison reserved for the worst crimes. Reign of 'Isa Khan Bardurrani and Siege of Herat (April 1856–October 1856) 

With the death of Mohammad Yusuf Sadozai on April 28, Herat broke into chaos. Four contenders emerged. 'Isa Khan managed to overthrow Mohammad Yusuf but his rule was challenged inside the city. Ghulam Khan Qufaza'i revolted and "beat the drum of kingship in the vicinity of the grey tower of Herat in his own name." A son of Sa'id Mohammad Khan established his control around Qutub-i Chaq. 'Abbas Khan Rayhan established a republican emirate around the neighborhood of Khwaja 'Abdullah Misri. (Both Khwaja 'Abdullah Misri and Qutub-i Chaq are historic neighborhoods of Herat.) However, 'Isa Khan eventually managed to defeat these rivals for power. 'Isa Khan renewed the ceremony hoisting the British flag. 'Isa Khan was determined to resist and reportedly wouldn't give up the fight until the last dog in the town was eaten. To prepare against the Iranian siege, 'Isa Khan directed the construction of tunnels and earthworks. Iranian gunners showered the city daily with cannonballs. Hasan 'Ali Khan took some of the Herati earthworks but wasn't able to take the city. 'Abbas Khan made a few initial attacks on the Iranian camp but eventually switched sides and joined Husam al-Saltanah. In September 1856 Iranian troops captured Farah. In the same month, a conspiracy was formed where the Shi'a population of the city would open the gates to the Iranians. The Iranians attempted to breach the city, but it failed with 250 Iranians killed, and many Shi'a were massacred. On October 25, 1856, Herat fell to the Iranian forces. The Mohammadzais took advantage of this to capture Farah on 30 October 1856. 'Isa Khan surrendered on the condition that his family and property would be spared. However, the Iranians did not keep their promise and as a direct order from the Shah he was executed. Iranian rule over Herat (October 1856–August 1857) 
Iranian sources portray Qajar rule over Herat in a rosy picture. Sultan Ahmad Khan (1857–1862) 

The Treaty of Paris forbade Iran to interfere in the affairs of Herat unless necessary and respect the region's independence. The Sadr-i Azam, realizing that according to the treaty they would have to reinstall Mohammad Yusuf as ruler of Herat, instead turned Yusuf over to relatives of Sa'id Mohammad Khan and promptly killed him. Two days after Mohammad Yusuf's execution, Sultan Ahmad Khan left Tehran and was installed onto the throne of Herat in April 1857. Thus, the Iranians violated the treaty before it was even ratified on 2 May 1857. Iranian forces evacuated Herat in September 1857 and left Sultan Ahmad Khan to govern the area. They destroyed the city's defenses, took the crops, and seized 6,000 muskets.Sultan Ahmad Khan aspired to be independent but his position was like "that of a clay pot between two iron ones." He was seen as an Iranian puppet by his people and there were multiple plots against him. There was one faction led by Mohammad Yusuf's brother, Mohammad Reza, and was an associate of the British-Afghan spy Zayn al-Abdin. In 1858 a plot began to overthrow Sultan Ahmad Khan and replace him with Mohammad Reza, which was supported by the British. However the Sadr-i Azam caught wind of it and informed Sultan Ahmad Khan, who promptly imprisoned the conspirators. Foreign Relations under Sultan Ahmad Khan

Mohammadzai Conquest of Herat (1862–1863) 

Khan captured Farah soon after on 11 March 1862, which became Dost Mohammad Khan's casus belli to launch an attack on Herat. On July 6, Farah was captured by the Mohammadzais. On July 19 or July 22, Sabzawar was captured. By July 28, Herat was besieged. At the same time Mohammadzai forces advanced through Maimana and the Aimaq lands, eventually reaching the city in August. In January 1863 Ahmad Khan's wife, Nawab Dokhtar, died. Since she was also Dost Mohammad Khan's daughter, both sides mourned her death. Ahmad Khan ended up dying from grief on March 6, 1863, being succeeded by his son Shah Nawaz Khan. On May 27 Dost Mohammad made a final assault on Herat. The city was conquered by the Emirate of Afghanistan, ending the Principality of Herat. Attempts at Reviving Herati Independence (1863–1881) 
Even though Herat was annexed into Afghanistan, attempts were made at restoring descendants of the former rulers. The last such event was during Ayub Khan's reign over Herat. A rebellion broke out in the city and the Kabul troops massacred all the descendants of Yar Mohammad Khan Alakozai. Government, military, and subdivisions

Government

Taxation 
In Herat, most land was held free or held on condition of military service. Only cultivated land was taxed, and the ruler of Herat often took as much produce as he wanted from yields. Under Kamran Shah, taxes were heavy and oftentimes grain farmers would be subject to additional taxes that were added to the ones already in place. Land rentals in Herat demanded that a large share of the produce (4/5ths) went to the landlord and the rest to the tenant. Livestock were annually taxed. 10 percent duties were imposed on all animals. Shi'a citizens of Herat were forced to pay more taxes(like the kharaj tax) than Sunni citizens. It was termed as sar khanah in the 19th century. Afghans didn't have to pay the sar khanah but they did have to give up the equivalent of two shillings for every house they possessed. Taxes were levied on the city's shops (especially those in the central marketplace). Duties were imposed on almost anything sold in the bazaars, and things like articles and meat had to be sold with the Shah's stamp on them. Military reforms 
Many military reforms in Herat were helped by Iran or by Iranian defectors. Under Yar Mohammad Khan Alakozai the Herati army was reformed based on the Iranian military. In 1849, with the help of Iran he created five infantry regiments composed of 500 men each, who were issued felt hats. They were given muskets and were commanded by a brigadier general (Sartib) and major (Yavar). Sarhangs (Lieutenant colonels) and Yavars were also appointed for the cavalry platoons. However, not everyone responded positively to these changes. 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. In response to this, Sa'id Mohammad Khan took one of the uniforms, shaved his beard, and put it on in front of the soldiers. There were also defectors in the Iranian military who went to find service in Herat. In 1854, Husayn Khan, who was a Na'ib in the Iranian artillery corps, defected to Sa'id Mohammad Khan. He was then put in charge of Herat's artillery. He would serve Sa'id Mohammad Khan well and was present during the 1856 siege of Herat. Sultan Ahmad Khan also adopted military reforms, and his son Shahnavaz Khan would dress his infantry in British-style uniforms and train them in European infantry tactics. Subdivisions 
There is a general consensus on the number of provinces Herat had. The principality was centered around the Herat oasis and had outlying provinces dependent on it. There were reportedly 446 villages in the 8 districts (buluk) that made up the Herat province. According to Christine Noelle-Karimi the these districts were the following:

North of the Hari Rud:

Alanjan, Injil, Khiyaban, Sabqar, Ghurvan-Pashtan

South of the Hari Rud:

Udvan-Tizan, Guzara, Kamburaq

There were four provinces (velayat) in the principality, but the areas that were velayats are disputed. Ghourian, Awbeh, and Karokh are agreed on as velayat. Mohan Lal said Sabzawar was a velayat also, but Conolly disagrees and lists the region of Shafilan as a velayat. Both Kamran Shah Sadozai and Yar Mohammad Khan appointed their relatives as governors to peripheral regions, and they aren't considered as velayat. Trade, Society, and Population

Trade 
Herat's trade had declined since Timurid times when it was at its height. However, Herat and its bazaars were still a booming center of trade. 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. In particular, the city's trade prospered under Firuz al-Din Sadozai. There were many Hindu merchants selling goods among the bazaars of Herat. The city was a hub for trade, with products such as wheat, barley, rice, saffron, tobacco, and tea. Champagne lists sugar, porcelain, cloth, muslin, spices, leather, and pepper being traded in Herat. Stack lists silk, saffron, assafetida, pistachios, almonds, dried fruit, gold and silverwork, swords, cutlery, carpets, glassware, and metalwork as products sold in Herat. Heratis participated in the silk trade with the city of Shikarpur, although it wasn't very profitable. Under Kamran Shah and Yar Mohammad Khan trade declined and they heavily taxed the populace. According to one contemporary observer, he reduced Herat's trade "from 1000 parts to one." This meant that when the Iranians attacked Herat in 1837 the city was left virtually defenseless and only with the help of the Aimaq tribes was Herat able to survive. Herat in the Nineteenth century 

The city of Herat had declined since Timurid times. Ravaged by war, many of its old monuments were by this time ruins. However, it was still a formidable city. Before the 1837 siege, between 50 and 60,000 people resided in Herat. Population 
The population of Herat was of a various ethnic background, and was primarily Persian-speaking. When Mohan Lal visited the city, he noted that the main 3 components of the city's population were Bardurranis, Qizilbash, and Farsiwan (Shi'a Persian speakers), in which the Farsiwan were the majority. Shi'ites of Herat 
Before the Afghan takeover of Herat, the city of Herat was majority Shi'a, and many early-19th century travellers note the predominantly Shi'a character of Herat. By the time Mohan Lal visited the town in 1834, he was to note the city was majority Sunni. The explanation for this is that by this time the Shi'a were being oppressed by the Sadozais and many no longer openly practiced their faith. Jews of Herat 
The city of Herat had a small population of Jews. 600 Jews made the city their home. In 1839, when the Jews of Mashhad were forcibly converted to Islam, many fled to Herat rather than abandon their beliefs. During the Iranian occupation of the city in 1857, the Jews were forced to relocate to Mashhad in Khorasan, and around 3,000 people died during the forced march. In addition, their property was looted and were forced to pay 22,000 tomans. The Jews were living in poverty in Mashhad, imprisoned in a dilapidated inn known as Baba Qudrat. Many Jews were forced to beg in the streets. Many Mashhadis sympathized with the Jews and some risked their lives to bring food to them. Since many of the Jews were previous exiles from Mashhad during the 1839 forced conversion, the Iranian government claimed the Jews were Iranian subjects who betrayed their country. Hindus of Herat 
Around 700 or 1,000 Hindus lived in Herat. Many of them were merchants. The size of the Hindu population changed over time. In 1810, Charles Christie reported the size of the Hindu population of Herat to be around 600. 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. When Kamran Shah attempted to collect funds for an attack on Qandahar in 1830, many Hindus left rather than pay. Other Groups 
Herat had a small population of Armenians. Hazaras also inhabited the city. List of rulers

References

1793 establishments
1863 disestablishments
Herat
Former political entities in Afghanistan
Modern history of Afghanistan
Former countries in Central Asia
Former principalities
18th century in Afghanistan
19th century in Afghanistan
Herat Province