The Uyghur Khaganate, or, Uyghur Empire or Uighur Khaganate or Toquz Oghuz Country (Mongolian: Уйгурын хаант улс, Tang era names, with modern Hanyu Pinyin: traditional Chinese: 回鶻; simplified Chinese: 回鹘; pinyin: Huíhú or traditional Chinese: 回紇; simplified Chinese: 回纥; pinyin: Huíhé) was a Turkic empire that existed for about a century between the mid 8th and 9th centuries. They were a tribal confederation under the Orkhon Uyghur (回鶻) nobility, referred to by the Chinese as the Jiu Xing ("Nine Clans"), a calque of the name Toquz Oghuz.
Khagan Tengri Bögü met with Manichaean priests from Iran while on campaign, and was converted to Manicheism, adopting it as the official religion of the Uyghur Empire in 763. One effect of this conversion was the increase in influence of the Sogdians in the Uyghur court.
Tun Bagha Tarkhan ascended the throne with title Alp Qutlugh Bilge ("Victorious, glorious, wise") and enforced a new set of laws, which he designed to secure the unity of the khaganate.
The last great khagan of the Empire was a khagan with unknown name, bearing the title Kün tengride ülüg bulmïsh alp küchlüg bilge ("Greatly born in sun heaven, victorious, strong and wise")
The power of Uyghur Empire declined and the empire started to fragment after Tun Bagha Tarkhan's death in 789. The Tibetans took from Uyghurs the area of Beshbalik.
Collapse.......The following spring, in 840 AD, one of 9 Uyghur ministers, Kulug Bagha, rival of Kurebir, fled to the Kyrgyz tribe and invited them to invade from the north with a force of around 80,000 horsemen. They sacked the Uyghur capital at Ordu Baliq, razing it to the ground. The Kyrgyz captured the Uyghur Khagan, Kürebir (Hesa) and promptly beheaded him. The Kyrgyz went on to destroy other Uyghur cities throughout their empire, burning them to the ground. The last legitimate khagan, Öge, was assassinated in 847, having spent his 6-year reign in fighting the Kyrgyz,the supporters of his rival Ormïzt, a brother of Kürebir, and Tang China boundary troops in Ordos and Shaanxi, which he invaded in 841. The Kyrgyz invasion destroyed the Uyghur Empire, causing a diaspora of Uyghur people across Central Asia.
John Hopkins....Northern New Mexico