In 1863 Herat, which for fifty years previously had been independent of Kabul, was incorporated by Dost Mahomed Khan in the Afghan monarchy, and the Amir, Habibullah of Afghanistan, like his father Abdur Rahman before him, remained Amir of Herat and Kandahar, as well as Kabul.
Before his death at Herat, 9th June 1863, Dost Mahomed had nominated as his successor Shere Ali, his third son, passing over the two elder brothers, Afzul Khan and Azim Khan; and at first the new amir was quietly recognized.
But after a few months Afzul Khan raised an insurrection in the northern province, between the Hindu Kush mountains and the Oxus, where he had been governing when his father died; and then began a fierce contest for power among the sons of Dost Mahomed, which lasted for nearly five years.
His youngest son, Mahomed Omar Jan, was born in 1889 of an Afghan mother, connected by descent with the Barakzai family.
Though he disapproved of Lord Auckland's policy of substituting Shah Shuja for Dost Mahomed, he loyally supported the British in their advance on Afghanistan.