The border was inherited from the old Soviet Union-Afghan border, which largely took its current shape during the 19th century Anglo-Russian rivalry in Central Asia, known as the Great Game. With the Russian Empire having conquered the Khanate of Khiva and the Emirate of Bukhara, and with the British Empire controlling the British Raj, the two powers agreed to leave Afghanistan as an independent buffer state between them.