Second Anglo - Afghan War The Second Anglo – Afghan War was fought between the United Kingdom and the Emirate of Afghanistan from 1878 to 1880 , when the nation was ruled by Sher Ali Khan of the Barakzai dynasty , the son of former Emir Dost Mohammad Khan . This was the second time British India invaded Afghanistan . The war ended in the Treaty of Gandamak after attaining all the British geopolitical objectives . Most of the British and Indian soldiers withdrew from Afghanistan . The Afghans were permitted to maintain internal sovereignty but they had to cede control of their nation ' s foreign relations to the British . War . After tension between Russia and Britain in Europe ended with the June 1878 Congress of Berlin , Russia turned its attention to Central Asia . That same summer , Russia sent an uninvited diplomatic mission to Kabul . Sher Ali Khan , the Amir of Afghanistan , tried unsuccessfully to keep them out . Russian envoys arrived in Kabul on 22 July 1878 , and on 14 August , the British demanded that Sher Ali accept a British mission too . The Amir not only refused to receive a British mission under Neville Bowles Chamberlain , but threatened to stop it if it were dispatched . Lord Lytton , the viceroy , ordered a diplomatic mission to set out for Kabul in September 1878 but the mission was turned back as it approached the eastern entrance of the Khyber Pass , triggering the Second Anglo – Afghan War . First phase . A British force of about 40 , 000 fighting men , mostly British and Indians , was distributed into military columns which penetrated Afghanistan at three different points . An alarmed Sher Ali attempted to appeal in person to the Russian Tsar for assistance , but unable to do so , he returned to Mazari Sharif , where he died on 21 February 1879 . Treaty . With British forces occupying much of the country , Sher Ali ' s son and successor , Mohammad Yaqub Khan , signed the Treaty of Gandamak in May 1879 to prevent a British invasion of the rest of the country . According to this agreement and in return for an annual subsidy and vague assurances of assistance in case of foreign aggression , Yaqub relinquished control of Afghan foreign affairs to Britain . British representatives were installed in Kabul and other locations , British control was extended to the Khyber and Michni passes , and Afghanistan ceded various North - West Frontier Province areas and Quetta to Britain . The British Army then withdrew . However , on 3 September 1879 an uprising in Kabul led to the slaughter of Sir Louis Cavagnari , the British representative , along with his guards , and staff – provoking the next phase of the Second Afghan War . Second phase . Major General Sir Frederick Roberts led the Kabul Field Force over the Shutargardan Pass into central Afghanistan , defeated the Afghan Army at Char Asiab on 6 October 1879 , and occupied Kabul two days later . Ghazi Mohammad Jan Khan Wardak , and a force of 10 , 000 Afghans , staged an uprising and attacked British forces near Kabul in the Siege of the Sherpur Cantonment in December 1879 . Despite besieging the British garrison there , he failed to maintain the Siege of Sherpur , instead shifting focus to Roberts ' force , and this resulted in the collapse of this rebellion . Yaqub Khan , suspected of complicity in the massacre of Cavagnari and his staff , was obliged to abdicate . The British considered a number of possible political settlements , including partitioning Afghanistan between multiple rulers or placing Yaqub ' s brother Ayub Khan on the throne , but ultimately decided to install his cousin Abdur Rahman Khan as emir instead . Ayub Khan , who had been serving as governor of Herat , rose in revolt , defeated a British detachment at the Battle of Maiwand in July 1880 and besieged Kandahar . Roberts then led the main British force from Kabul and decisively defeated Ayub Khan on 1 September at the Battle of Kandahar , bringing his rebellion to an end . Abdur Rahman had confirmed the Treaty of Gandamak , leaving the British in control of the territories ceded by Yaqub Khan and ensuring British control of Afghanistan ' s foreign policy in exchange for protection and a subsidy . Abandoning the provocative policy of maintaining a British resident in Kabul , but having achieved all their other objectives , the British withdrew . Captured British soldiers . The British officer John Masters recorded in his autobiography that Afghan women in the North - West Frontier Province ( 1901 – 1955 ) of British India during the Second Anglo - Afghan War would castrate non - Muslim soldiers who were captured , like British and Sikhs . They also used an execution method involving urine ; Pathan women urinated into prisoner ' s mouths . Captured British soldiers were spread out and fastened with restraints to the ground , then a stick , or a piece of wood was used to keep their mouth open to prevent swallowing . Pathan women then squatted and urinated directly into the mouth of the man until he drowned in the urine , taking turns one at a time . Timeline of battles . There were several decisive actions in the Second Anglo – Afghan War , from 1878 to 1880 . Here are the battles and actions in chronological order . An asterisk ( * ) indicates a clasp was awarded for that particular battle with the Afghanistan Medal .