Uyghur Khaganate
The Kyrgyz state reached its greatest extent after defeating the Uyghur Khaganate in 840 AD, in alliance with the Chinese Tang dynasty.