In the mid 1840's the Wilayat of Balkh was in turmoil, beset by dynastic wars, plagues of locust, and cholera outbreaks, the economic situation in the region was also so dire that people sold their children into slavery in order to feed themselves. The Chahar Wilayat was being torn apart by succession crisis in the death of Zu'l-fiqar Khan, the ruler of Sar-I-Pul, Mizrab Khan, the ruler of Maimana, and Shah Wali Khan, the ruler of Andkhui. Rival claimants in the Chahar Wilayats fought each other for hegemony over one another. Often seeking support from their neighbors, including Yar Mohammad in Herat, and the Khan of Bukhara. When Ghazanfar Khan appealed for Bukharan aid against his rival, Shah Wali, Nasrullah Khan of Bukhara passed him over to Mir Wali, who joined forces with Ishan Uraq and Ishan Sudur, the Bukharan governors of Balkh and Aqcha. Alongside Shuja'al-din, the mutawalli of Mazar-I-Sharif, and Mahmud Khan, the ruler of Sar-I-Pul. Together, they subdued Hakim Khan of Sherberghan and reinstated Ghazanfar Khan. But as soon as Mir Wali and his allies withdrew, Shah Wali retook Andkhui, backed by Hukumat Khan, the ruler of Maimana, and Hakim Khan, the ruler of Sheberghan. Hukumat Khan in Maimana then appealed to Yar Mohammad Khan for military aid to depose his rival and half-brother, Sher Muhammad Khan, an appeal for aid that provided justification for Yar Mohammad Khan to invade. He marched on Maimana with an army of around 10,000 men and forced Sher Muhammad to flee for his life, reinstating Hukumat Khan as ruler of Maimana. Ghazanfar Khan then petitioned Yar Mohammad and Hukumat Khan to help him depose Shah Wali, to which they agreed. Andkhui fell after a short siege and was pillaged by Herati troops, who slaughtered the settlement's Turkman population. Following this victory, Yar Mohammad marched on Balkh, however its garrison refused to surrender. As winter was already setting in, and his armies supplies were low, Yar Mohammad decided not to risk besieging the citadel and ordered his troops to return to Herat. As they journeyed to Herat, many died to exposure of the extreme cold and starvation as they passed through the snowbound passes of the Murghab watershed. In the following year, 1849, Yar Mohammad marched on Maimana. However, Hukamat Khan, refused to allow Yar Mohammad to enter his capital, prompting Yar Mohammad to settle for a siege. Yar Mohammad besieged Maimana