The Treaty of Gandamak of 1879 required that Amir Abdur Rahman Khan had to accept British control of Afghanistan's foreign relations and to cede to the British a number of its southern frontier areas, including the districts of Pishin, Sibi, Harnai, and Thal Chotiali.
In 1881, Russian forces took Geok Tepe and in 1884 they occupied Merv.