His elder brother, the chief of the Barakzai, Fateh Khan, took an important part in raising Mahmud Shah Durrani to the sovereignty of Afghanistan in 1800 and in restoring him to the throne in 1809. Dost Mohammad accompanied his elder brother and then Prime Minister of Kabul Wazir Fateh Khan to the Battle of Attock against the invading Sikhs. Mahmud Shah repaid Fateh Khan's services by having him assassinated in 1818, thus incurring the enmity of his tribe. After a bloody conflict, Mahmud Shah was deprived of all his possessions but Herat, the rest of his dominions being divided among Fateh Khan's brothers. Of these, Dost Mohammad received Ghazni, to which in 1826 he added Kabul, the richest of the Afghan provinces.