Afghan Civil War (1863–1869)
The Afghan Civil War was fought from 9 June 1863 to January 1869. It began as a result of Dost Mohammad Khan's death on 9 June 1863 and the subsequent power struggles among his sons. Dost Mohammad consolidated his power in the second half of his reign within his inner family. His sons were appointed governors of provinces and effectively acted autonomous from the central government. This would inevitably lead to his sons fighting for control after his death. Sher 'Ali Khan reached Kabul first and was enthroned as Emir. However, his half brothers Mohammad Afzal Khan (at the time serving as governor of Afghan Turkestan) and Mohammad A'zam Khan conspired together against him and planned to seize the throne for themselves. In the spring of 1864 Sher 'Ali Khan discovered the correspondence between Azam Khan and Afzal Khan and marched north against them both. A'zam Khan was defeated in Khost and fled to India, but Sher 'Ali Khan changed his mind and settled his dispute with Mohammad Afzal Khan after a battle at Bajgah in the late spring of 1864. However, the prospect of peace was ruined when 'Abd al-Rahman Khan, the son of Mohammad Afzal Khan, made plans to overthrow Sher 'Ali Khan. Afzal was imprisoned and Rahman fled to Bukhara to escape the same fate. In 1865 Sher 'Ali Khan moved against Kandahar to defeat his rebellious uterine brother, Muhammad 'Amin Khan. Although he crushed the revolt and managed to kill Muhammad 'Amin Khan, Sher 'Ali's son and heir was also killed, which took a toll on his mental health resulting in his abdication. Mohammad Afzal Khan's forces took advantage of this to defeat Sher 'Ali Khan's forces in the spring of 1866 and take Kabul. Sher Ali Khan would continue to suffer defeat after defeat although gaining some success when the new governor of Afghan Turkestan and a son of Akbar Khan, Fayz Muhammad Khan, defected to him. In September 1867 Fayz Mohammad Khan was defeated near Jabal Siraj, dying from a cannonball in the midst of the battle. However, shortly after this Mohammad Afzal Khan succumbed to cholera, and as a result Abdur Rahman Khan and Mohammad Azam Khan fought over the succession. This would give Sher 'Ali Khan a chance to take back the throne. He developed a plan: The local rulers of Turkestan would resist 'Abd al-Rahman Khan for as long as possible, while he would recapture Qandahar and march on Kabul. His plan worked, and in May 1868 the armies of Sher 'Ali Khan entered Kandahar in triumph while 'Abd al-Rahman Khan was stuck besieging Maimana. From there A'zam Khan's fall was rapid. His armies were routed and Sher 'Ali Khan triumphantly entered Kabul on 8 September 1868. Mohammad A'zam Khan fled to Iran and died there, while 'Abd al-Rahman Khan fled to Samarqand, living there in exile until the Second Anglo-Afghan War. During the war the Durrani tribes of Helmand fought on the side of Sher 'Ali Khan. Civil War 
On June 9, 1863, Dost Mohammad Khan died 12 days after the capture of Herat. Just before his death, he put a turban on Sher 'Ali Khan's head, calling him the "Lion of Ali". However, Sher 'Ali Khan's brothers opposed his succession. Reportedly, even before Dost Mohammad Khan was buried Sher 'Ali Khan's younger brother Mohammad Aslam Khan planned to kill him with a pistol. Mohammad Afzal Khan prevented Aslam Khan from carrying out this assassination, but he made his own plans to prevent Sher 'Ali Khan from gaining the throne. Sher Ali Khan spent three days in mourning the passing of his father, before being enthroned on June 12, 1863, in the Friday Mosque of Herat. A'zam Khan obtained oaths of allegiance to Sher 'Ali Khan from the people in the mosque. However, he wrote to Afzal Khan at Balkh begging him to march on Kabul and take the city before Sher 'Ali Khan arrived. Revolt in Afghan Turkestan 
Mohammad Afzal Khan opposed Sher 'Ali Khan's ascension to the throne and sought help from the local Uzbek rulers of the area. In July 1863 he promised them autonomy in exchange for supporting his march on the Afghan capital. However, he had been the governor of Afghan Turkestan for quite some time and in fact was the primary instigator in the destruction of the Uzbek khanates of the region. As a result, the local rulers rebelled and for the most part sided with Sher 'Ali Khan throughout the war. Events in the Chahar Wilayat 
Husain Khan Ming, the ruler of Maimana, defected to Sher 'Ali Khan and began to attack garrisons around Khairabad and Daulatabad. He was encouraged by the Emir of Bukhara, Muzaffar Khan, who promised a Bukharan army would cross the Amu Darya and liberate the area from the Afghans. At the same time, however, Afzal Khan sent ambassadors to Bukhara on possible assistance for his cause. In early August 1863, the Bukharans sent their own envoy to Takhtapul to discuss the alliance. However, the negotiations failed and Afzal Khan reneged on his promise for autonomy due to widespread revolts in the area, including a revolt by the garrison of Khanabad. According to the Siraj al-Tawarikh, the garrison pelted the door of 'Abd al-Rahman Khan's house and looted property in the town, only being suppressed upon 'Abd al-Rahman Khan's troops arriving at the city. Afzal Khan forced the ruler of Andkhui, Ghazanfar Khan, to join the campaign against Maimana, disrupting the caravan routes with Bukhara. However, despite clashes between the Afghan and Maimanagi troops, neither side could gain an advantage. Afzal Khan began to lose much ground in the Chahar Wilayat. Fayz Mohammad Khan and Mohammad Zaman Khan, commanders at Sheberghan and Sar-i Pol respectively, defected to Sher 'Ali Khan. Shortly after, Ghazanfar Khan of Andkhui declared his independence and expelled the Afghan garrison from the city. Afzal Khan was forced to recall all troops to Aqcha and defend Balkh against Uzbek incursions. He would soon be faced with a revolt in Qataghan. Qataghani Revolt and Conquest of Badakhshan 
The Mir Ataliq of Qunduz, who had been in exile for some time, saw the civil war as an opportunity to take back Qataghan from Afghan domination. While Sher 'Ali Khan was still in Herat, the Mir Ataliq sent his son, Sultan Murad, into the area to stir up discontent. 'Abd al-Rahman Khan sent 3 infantry regiments, 1,000 cavalry, 12 field guns, and 2,000 khasadars under the leadership of Mohammad 'Alam Khan and Ghulam Mohammad Khan to suppress the revolt. Mohammad 'Alam Khan marched ahead and reached Nahrin before the rest of the army. However, he and his 200 horsemen had ridden into an ambush. 2,000 Uzbek cavalry charged towards him. Mohammad 'Alam Khan's cavalry deserted him until he had only 20 left, and they were all massacred by the Uzbek swords. They attempted to seize Mohammad 'Alam Khan's head but suffered 300 casualties due to the main Afghan army arriving. The next day, the Afghans faced the 40,000 Qataghani troops in the field. The bitter battle lasted into the evening, and the Afghan forces adopted the British tactic of the infantry square, tearing into Qataghani forces. As a result, 10,000 Qataghanis were killed or wounded while only 21 Afghans (Mohammad 'Alam Khan and his companions) were killed and 10 were wounded. The battle of Nahrin shattered the revolt and the locals were forced to submit. Sultan Murad fled with 6,000 men (3,000 of which had been sent by the mirs of Badakhshan to aid him), and 3,000 Qataghani troops were taken captive by the Afghans. Afzal Khan fined the region 12 lakh (1.2 million) rupees. Some Badakhshani remnants of the rebellion disguised themselves as merchants and had inflicted a number of casualties on the Afghan camp. However, they were eventually executed by being blown from cannons. The Siraj al-Tawarikh accuses them of being thieves but according to Lee, it is more likely that they were guerilla leaders of the revolt. 20 days after the execution, Jahandad Khan of Badakhshan learned of their arrest and sent an envoy to request they be freed. However, the envoy was harshly sent back to Badakhshan. 'Abd al-Rahman Khan sent 3,600 infantry and 3,000 cavalry against Jahandad Khan, first reaching Taleqan and then capturing the town of Farkar. Jahandad Khan had requested Bukharan aid to make the mirdom a Bukharan protectorate, but he was informed that Badakhshan was in Kabul's sphere of influence and he should submit to them, although if they were oppressed by Kabul the Bukharan government would intervene. Jahandad Khan was forced into submission and was to pay tribute to the Afghans, aiming to avoid the fate of the Mir Ataliq. In the end though, by September 1863 Afzal Khan was forced to submit to Sher 'Ali Khan, as the loss of the Chahar Wilayat showed the reality of the situation. He was forced to proclaim the khutbah and strike coins in Sher 'Ali Khan's name. Sher Ali Khan's march to Kabul 
Sher 'Ali Khan stayed in Herat for a few months before leaving for Kabul, appointing his son, Mohammad Yaqub Khan as governor of Herat. Mohammad A'zam Khan, dissatisfied with the Amir, left his camp and proceeded in the direction of Kabul; eventually he reached Baraki Rajan in the Logar district. Mohammad 'Ali Khan, the governor of Kabul, sent forces to apprehend him. As Logar's population began to switch allegiance, A'zam Khan retreated to his jagir (comprising the districts of Khost, Zurmat, and Kurram). The soldiers sent after A'zam Khan stayed in Logar until further orders. Mohammad Aslam Khan also separated himself from the royal entourage as he intended to retire to his jagir in the Hazarajat. However he was intercepted and captured along the way and brought to the Amir's presence. Sher 'Ali Khan at first scolded him, but soon forgave him and restored his privileges. After four days Mohammad Aslam Khan escaped and joined his brother Sardar Mohammad Husain Khan. Mohammad 'Amin Khan, a half-brother of the Amir and the governor of Qandahar, was also dissatisfied with Sher 'Ali Khan. The Amir sent a group of influential men to convince 'Amin Khan to accept the Amir's rule. This mission was unsuccessful, and 'Amin Khan gave secret orders that anyone along the Qandahar-Kabul road who was caught giving the Amir's entourage provisions should be punished. This act only resulted in Sher 'Ali Khan plundering the fields as far as Ghazni. While at Ghazni, he received a letter of apology from Mohammad A'zam Khan for his conduct. The Amir desired to see him in person and proceeded to Zurmat, whereupon A'zam Khan agreed to meet him if some of the nobility would visit A'zam Khan. Sher 'Ali Khan acceded to his request, and A'zam Khan was received with due honor. Sher Ali Khan said to him: "You were the first to pledge allegiance to me, and you called upon all the people to do the same. Now, you are the first to desert me. If you have a desire to ascend the throne, you are welcome, and I will serve you as a loyal and obedient brother; otherwise you should help me in the administration as a brother ought to do. " A'zam Khan apologized for his misdeeds and promised to join the Amir's entourage after 3 months. He also gave his son, Mohammad Sarwar Khan, as a hostage. With affairs in the region settled, Sher 'Ali Khan proceeded to Kabul and entered the city. Meanwhile, Aslam Khan had gone over to his jagir in the Hazarajat. He soon found out that one of his regiments, consisting of 800 men, had plundered the Bamian district under the command of Najm al-Din and had left for Kabul, deserting him. His brother, Mohammad Hasan Khan, advised him to submit to the Amir, and Aslam Khan agreed on the condition that Hasan Khan should negotiate with the Amir on his behalf. Sher 'Ali Khan refused to compromise, and the remaining two regiments in the region deserted Aslam Khan. To make matters worse for Aslam Khan, the Hazaras revolted against him and forced him to ask help from Afzal Khan. Afzal Khan dispatched 1,000 men to protect Aslam Khan and his family,  allowing them to be extradited to Turkestan. Although 'Abd al-Rahman Khan distrusted Aslam Khan and wished to see him gone, Afzal Khan shut down his complaints on the guise that he sought refuge and was unjust for him to be driven out. Around the time of the revolt of Sultan Mohammad Khan Mohmand, Ata Mohammad Khan of Najil rebelled and fortified his stronghold. Sardar Mohammad 'Ali Khan, son of Sher 'Ali Khan and the governor of Jalalabad, sent troops to Laghman. They destroyed the fort and seized Ata Mohammad Khan. Afzalid Revolt and the Battle of Bajgah. Afzal Khan's submission to Sher 'Ali Khan finally restored, if only temporarily, peace towards the province in the winter of 1863/64. Rumors continued to circle that Afzal Khan would march on Kabul once the Fitr and Nowruz festivals ended. In late February 1864, when Bukharan forces conquered the principality of Kulab, Afzal Khan aided the Bukharan army  due to previous Kulabi raids on Qataghan and in return received the submission of the Mir Ataliq, who had fled there when the Qataghan rebellion was crushed a year previously. By March 1864, the relationship between Afzal Khan and Sher 'Ali Khan would finally explode. The Amir discovered correspondence between Afzal Khan and A'zam Khan, which included notes by A'zam Khan urging Afzal Khan to take the throne, and a letter from Afzal Khan stating that he planned to march towards Kabul around April 24. Sher Ali Khan had the conspirators arrested, and on March 20 he held a conference with his closest advisors on what to do with the rebellious Afghan princes. The following day on March 21, Sher Ali Khan sent his son Mohammad 'Ali Khan from Jalalabad to attack Bajgah and gave Mohammad Yaqub Khan orders to oppose Afzal Khan if he attempted to attack the area. Sher 'Ali Khan also promised the native rulers of Afghan Turkestan autonomy in order for them to support his cause, sending Ishan Uraq to spread anti-Afzalid propaganda in the province. When Mohammad Afzal Khan heard of Sher Ali Khan's decision, he inserted his own name into the khutbah and marched towards Bajgah in order to reinforce it. He also tried to counter Ishan Uraq's propaganda with his own promises of autonomy, however due to his role in the Afghan conquest of the region, his claims were not regarded as genuine. This and the fact that opposition to Sher 'Ali Khan was scattered throughout the country allowed the Amir to divide and conquer his enemies. In Kurram, the Amir's forces invaded and occupied that district and forced A'zam Khan to flee to India. Mohammad 'Ali Khan, the son of the Amir, marched towards Bamiyan unopposed. As he marched members of the royal family switched their allegiance to him, such as Sardar Wali Mohammad (who commanded the garrison of Takhtapul). When he reached Saighan, he took a defensive position south of the Bajgah pass in order to wait for reinforcements. The Balkh army began raiding his camp, seeing their forces as stronger. These raids riled up his men, who forced Mohammad 'Ali Khan to allow them to retaliate. On May 17, 1864, Mohammad 'Ali Khan launched an attack on the Balkh army at Bajgah. His forces climbed the heights around the enemy, catching them while they were still sleeping and bombarding them with artillery. Na'ib Ghulam Ahmad Khan, who commanded the Balkh army, fled from the carnage. Afzal Khan, who heard the sounds further up the road, sent men to aid the devastated vanguard. However, they failed to sent scouts ahead and moved right towards an ambush. Mohammad 'Ali Khan's artillery bombarded them, leaving very few survivors. Afzal Khan, realizing all hope was lost, led his army in retreat towards Doab. Mohammad 'Ali Khan reported to his father on the victory at Bajgah and a 51-gun salute was fired in Kabul in recognition of his services. Five days later he marched towards Rui, a holdout of the Balkh army's remnants, and annihalated them. Local leaders, such as Sultan Murad of Qunduz and Hakim Khan of Sheberghan, came to tender their submission. References

1860s in Afghanistan
Barakzai dynasty
Emirate of Afghanistan
Wars involving Afghanistan