Escalated a few years after the establishment of the emirate, the Russian and British interests were in conflict between Muhammad Shah of Iran and Dost Mohammad Khan, which led to the First Anglo-Afghan War, fought between 1838 and 1842.[5] During the war, Britain occupied the capital, Kabul, of the then called Emirate of Kabul, in an effort to prevent Afghanistan from coming under Russian control and curb Russian expansion, while also keeping Afghanistan in the British fold under a puppet leader, Shah Shujah Durrani. The war ended with Dost Mohammad returning to the throne, with the British withdrawing; unable to subjugate the country, they forged greater ties instead, allowing Dost Mohammad to move toward uniting the dis-united state of Afghanistan, which split from the Durrani Civil wars brought on by the sons of Timur Shah.[6]
Upon the death of Dost Mohammad in 1863, he was succeeded by his son, Sher Ali Khan. However, three years later, his older brother Mohammad Afzal Khanoverthrew him. In 1868, Mohammad Afzal Khan was himself overthrown and replaced as Emir by Sher Ali, who returned to the throne after spending few short years in exile in Russia. His return as Emir led to new conflicts with Britain. Subsequently, the British marched on 21 November 1878 into Afghanistan and Emir Sher Ali was forced to flee again to Russia, but he died in 1879 in Mazar-i-Sharif.[7] His successor, Mohammad Yaqub Khan, sought solutions for peace with Russia and gave them a greater say in Afghanistan's foreign policy. Meanwhile, he signed the Treaty of Gandamak with the British on 26 May 1879, relinquishing solely the control of Afghanistan foreign affairs to the British Empire. However, when the British envoy Sir Louis Cavagnari was killed in Kabul on 3 September 1879, the British offered to accept Abdur Rahman Khan as Emir. The British concluded a peace treaty with the Afghans in 1880, and withdrew again in 1881 from Afghanistan. The British, in 1893, forced Afghanistan to consent to a new border, termed the Durand Line, which cuts right through the historic Pashtun settlement region.[8]
After the war, Emir Abdur Rahman Khan, who struck down the country reformed and repressed numerous uprisings. After his death in 1901 his son Habibullah Khan succeeded as emir and continued reforms. Habibullah Khan sought reconciliation with the UK, where he graduated in 1905 with a peace treaty with Russia, stretching for defeat in the Russo-Japanese War had to withdraw from Afghanistan. In the First World War, Afghanistan remained neutral, despite German and Ottoman efforts (Niedermayer–Hentig Expedition). In 1919 Habibullah Khan was assassinated by political opponents.[9]
Habibullah Khan's son Amanullah Khan was in 1919 against the rightful heir apparent Nasrullah Khan, the then Emir of Afghanistan. Shortly afterwards another war broke which lasted for three months.[10][11][12][13] This war was ended with the Anglo-Afghan Treaty of 1919 after which, the Afghans were able to resume the right to conduct their own foreign affairs as a fully independent state.[14] Amanullah Khan began the reformation of the country and was crowned 1926 Padshah (king) of Afghanistan and founded the Kingdom of Afghanistan.[15]
^Despite agreeing to the terms of the Treaty of Gandamak, Abdur Rahman Khan held Afghanistan as a de-facto independent state by holding external affairs with other nations such as Persia and Russia, and often opposing the British.
^Baxter, Craig (2001). "The First Anglo–Afghan War". In Federal Research Division, Library of Congress (ed.). Afghanistan: A Country Study. Baton Rouge, LA: Claitor's Pub. Division. ISBN1-57980-744-5. Archived from the original on 25 January 2020. Retrieved 23 September 2011.
^Islam and Politics in Afghanistan, Olesen, page 101
^Dijk, Ruud van; Gray, William Glenn; Savranskaya, Svetlana; Suri, Jeremi; Zhai, Qiang (13 May 2013). Encyclopedia of the Cold War. Routledge. ISBN9781135923105. Archived from the original on 19 May 2016. Retrieved 6 May 2016.