In the 18th and 19th centuries it was the capital of a rather large eponymous, sometimes independent, sometimes autonomous Uzbek-Tajik khanate that in the 1820s encompassed land from Balkh to the Pamir Mountains. It was part of The Great Game between the British and Russians. This khanate was finally destroyed by Afghanistan in 1859. Between one hundred and two-hundred thousand Tajiks and Uzbeks fled the conquest of their homeland by Russian Red Army and settled in northern Afghanistan.