The Kyrgyz state reached its greatest expansion after defeating the Uyghur Khaganate in 840 AD. From the 10th century the Kyrgyz migrated as far as the Tian Shan range and maintained their dominance over this territory for about 200 years.