After the decline of the Durrani dynasty in 1823, Dost Mohammad Khan established the Barakzai dynasty after becoming the next Emir of Afghanistan. It was not until 1826 that the energetic Dost Mohammad Khan was able to exert sufficient control over his brothers to take over the throne in Kabul, where he proclaimed himself the Shah.