Question: What dynasty was founded by one of the prominent rulers of Afghanistan during the First Anglo-Afghan War, who had a  dispute with former emir Shah Shujah hom they installed upon conquering Kabul in August 1839?

<P0-S0> Dost Mohammad Khan (Pashto: دوست محمد خان‎ , December 23, 1793June 9, 1863) was the founder of the Barakzai dynasty and one of the prominent rulers of Afghanistan during the First Anglo-Afghan War. <P0-S1>  With the decline of the Durrani dynasty, he became Emir of Afghanistan from 1826 to 1839 and then from 1843 to 1863. <P0-S2>  An ethnic Pashtun, he was the 11th son of Sardar Payendah Khan (chief of the Barakzai tribe) who was killed in 1799 by Zaman Shah Durrani. <P0-S3>  Dost Mohammad's grandfather was Hajji Jamal Khan. <SEP> <P1-S0> The 1842 Kabul Retreat (or Massacre of Elphinstone's army) took place during the First Anglo-Afghan War. <P1-S1>  At the beginning of the conflict, British forces had defeated the forces of Afghan Emir Dost Mohammad Barakzai and in 1839 occupied Kabul, restoring the former ruler, Shah Shujah Durrani, as emir. <P1-S2>  However a deteriorating situation made their position more and more precarious, until an uprising in Kabul forced the then commander, Major General Sir William Elphinstone, to withdraw the garrison. <P1-S3>  To this end he negotiated an agreement with Wazir Akbar Khan, one of the sons of Dost Mohammad Barakzai, by which his army was to fall back to the British garrison at Jalalabad, more than 90 mi away. <P1-S4>  As the army and its numerous dependents and camp-followers began its march, it came under attack from Afghan tribesmen. <P1-S5>  Many of the column died of exposure, frostbite or starvation or were killed during the fighting. <SEP> <P2-S0>  Initially, the British successfully intervened in a succession dispute between emir Dost Mohammad (Barakzai) and former emir Shah Shujah (Durrani), whom they installed upon conquering Kabul in August 1839. <P2-S1> The First Anglo-Afghan War (also known as Disaster in Afghanistan) was fought between British imperial India and the Emirate of Afghanistan from 1839 to 1842. <P2-S2>  The war is notorious for the loss of 4,500 British and Indian soldiers, plus 12,000 of their camp followers, to Afghan tribal fighters, but the British defeated the Afghans in the concluding engagement. <P2-S3>  However, in 1841 the Army of the Indus, numbering between 24,000 and 28,000 including families of soldiers, military and political pundits, suffered a series of defeats at the hands of rebel Afghan tribesmen. <P2-S4>  The main British Indian and Sikh force occupying Kabul, having endured harsh winters as well, was almost completely annihilated while retreating in January 1842. <P2-S5>  It was one of the first major conflicts during the Great Game, the 19th century competition for power and influence in Central Asia between Britain and Russia. <SEP> <P3-S0> The Emirate of Afghanistan (Pashto: د افغانستان امارت‎ "Da Afghānistān Amārat ") was an emirate between Central Asia and South Asia, which is today's Islamic Republic of Afghanistan. <P3-S1>  The emirate emerged from the Durrani Empire, when Dost Mohammed Khan, the founder of the Barakzai dynasty in Kabul, prevailed. <P3-S2>  The history of the Emirate was dominated by 'the Great Game' between the Russian Empire and the United Kingdom for supremacy in Central Asia. <P3-S3>  This period was characterized by the expansion of European colonial interests in South Asia. <P3-S4>  The Emirate of Afghanistan continued the war with the Sikh Empire, which led to the invasion of Afghanistan by British-led Indian forces who completely wiped out the Afghans in 1842 but did not fulfil their initial war objectives. <P3-S5>  However, during the Second Anglo-Afghan War, the British again defeated the Afghans and this time the British took control of Afghanistan's foreign affairs until Emir Amanullah Khan regained them after the Anglo-Afghan Treaty of 1919 was signed following the Third Anglo-Afghan War.