The Emirate of Afghanistan, known internationally as the Emirate of Kabul until 1855, was an emirate in Central Asia that encompassed present-day Afghanistan, parts of present-day Iran, Pakistan, Turkmenistan and Tajikistan. The emirate emerged from its predecessor Durrani Empire, when the Barakzai dynasty prevailed in Kabul.
The history of the Emirate was dominated by the 'Great Game' between the Russian Empire and the British Empire for supremacy in Central Asia. This period was characterized by European influence in Afghanistan. The Emirate of Afghanistan continued the Durrani Empire's war with the Sikh Empire, losing control of the former Afghan stronghold of the Valley of Peshawar at the Battle of Nowshera on 14 March 1823. This was followed in 1838 by the First Anglo-Afghan War with British forces. The war eventually resulted in victory for Afghans, with the British withdrawal in 1842, and Dost Mohammad being reinstalled to the throne. However, during the Second Anglo-Afghan War (1878–1880), the British and Afghans signed the Treaty of Gandamak, which allowed the British to assume control of the Afghan territories within modern-day Pakistan as well as of Afghanistan's foreign affairs, on the condition that a subsidy be paid to the Afghans and the British military fully withdraw. Emir Amanullah Khan signed the Anglo-Afghan Treaty of 1919 following the Third Anglo-Afghan War, gaining full Afghan autonomy, and the removal of Afghanistan's status of being a de-jure British protectorate. In 1926, Amanullah Khan reformed the country as the Kingdom of Afghanistan, becoming its first King.