Sher Ali, having performed the funeral rites of his father at Herat, left the place in charge of his son Yacub, and set out for Kabul On the march commenced the entangled chain of intrigues, plots, and disaffections which were soon to throw the country into civil war. Sher Ali reached Kabul in September, and passed the winter there undisturbed In spring began the looked-for hostilities, His elder brothers, Afzal, Governor of Balkh, and Azim of Kurram, were the first to oppose him. He at once sent a force against the latter, who was defeated, and fled into British territory where he found asylum at Rawal Pindi Against the former the Amir marched in person. He inveigled Afzal into his camp on fair promises, and then made him prisoner. After securing Balkh and settling the affairs of the country, Sher Ali returned to Kabul He was now opposed by Amin Khan, his own brother, at Kandahar. He took the field against him, and on 6th June, 1865, fought the battle of Kajbaz near Kelat-i-Ghilzai, in which, though he won the victory, he lost both his brother and his son and heir elect, Muhammad Ali - nephew and uncle having fallen together in single combat. Sher Ali went on to Kandahar, and immediately gave himself up to grief for the double bereavement; and it was a grief peculiar to the man's temperament and characteristic thereof. He shut himself up for several months, during which time he continued in a despondent, morose, and irritable state of mind, and was at one time supposed to have lost his reason.
Whilst Slier Ali was thus inactive at Kandahar, Abdurrahman, son of the imprisoned Afzal, seized Balkh, and pushing forward took Kabul in February, 1866. The news of this loss suddenly roused Sher Ali from his lethargy, and he set out for Kabul without delay, with Afzal prisoner in his camp Abdul Rahman advanced to meet him, and the two armies came into action near Shekhabad, on the Ghazni road, on the 10th May, when Sher Ali was defeated and put to flight Afzal was now released, and being joined by his brother Azim, proceeded with his son to Kabul, where he was well received, and at once proclaimed Amir.
Sher Ali, after some stay at Kandahar, proceeded to Herat in the beginning of February, 1867, and thence he joined Fyz Muhammad, who had come over to his side, in Turkestan It was at this time that Sher Ali sent his son Yacub, Governor of Herat, to meet the Shah of Persia at Mashhad. Whatever the nature of the interview, Sher Ali and Fyz Muhammad presently advanced towards Kabul. Abdurrahman went out to Hindu Kush to oppose them, and in the fight that ensued Fyz Muhammad was killed and Sher Ali put to flight He stayed for some time in Balkh and then returned to Herat, where he arrived in January, 1868. Meanwhile, the ruling Amir, Afzal, died at Kabul in October preceding, and was succeeded as Amir by Azim.
The rule of both these temporary Amirs had proved very unpopular, owing partly to their licentious habits and oppressive rule, and partly to the strong measures they adopted to procure the means for carrying on the war. The moment seemed opportune for Sher Ali to essay another attempt to recover his capital. In April, 1868, he sent forward Yacub to take Kandahar, which was held by Sarwar, the son of Azim. This he did without much opposition, and was joined there by his father in the following June. Some time was spent here in preparations and buying over Azim's troops, and then in September, Sher Ali, Yacub leading the way, recovered Kabul, avoiding Azim, who had come out to oppose him at Ghazni, by a detour through Zurmat. On this Azim's troops went over bodily to Sher Ali, and he himself fled to Turkistan. Here he managed to raise a fresh force and made an attempt to re-take Kabul, in January of the following year. He was signally defeated and forced to flee with only a few attendants to Persia, where he died some months later.
Sher Ali, having now re-established himself as Amir on the throne of Kabul, at once threw himself on the protection of the British Government, and came to India to meet the Viceroy, Lord Mayo, at Amballa. The reception accorded him was most honorable and splendid, and Sher Ali went back to Kabul highly flattered and pleased with everything except the real business he had come upon. Apart from this disappointment, the Amir had very good reason to be amply satisfied and deeply grateful - if indeed there be such a quality as gratitude in the Afghan nature. He had received a reception which was not only flattering to himself, but was an honor conferred on his nation; he was acknowledged before all the world as the Amir of Kabul and the friend of the British Government. The consequence was that the consolidated Afghanistan which he inherited from his father and which he had lost during five years of civil war, came back to his hands in its integrity ; and there was not a man in the country bold enough to raise a finger against the ally of the British.
For the first three years the renewed relations of the two Governments proceeded smoothly enough, and with high promise for the future. The success of the policy initiated by Lord Mayo was proved by the fruit it bore. The former professed enemy of the British seemed to have changed his dislike, and was lavish in his professions of devotion and attachment, and equally lavish in his expectations of further favours. The province of Badakhshan and the northern "boundary of Afghanistan were secured for the Amir by the British Government after long negotiation with the Russian Government. Sistan remained a question in dispute between the Amir and the Shah of Persia. Its settlement was submitted by the contending parties to the arbitration of the British Government Their decision was given against the Amir, and it was more than he could bear. It undid all the good effected by the Amballa interview, and the newly-made friend reverted to the professed enemy of old.