History of the Uyghur people
The history of the Uyghur people, as with the ethnic origin of the people, is an issue of contention between Uyghur nationalists and the Chinese authority. Uyghur historians viewed the Uyghurs as the original inhabitants of Xinjiang with a long history. Uyghur politician and historian Muhemmed Imin Bughra wrote in his book "A history of East Turkestan", stressing the Turkic aspects of his people, that the Turks have a 9000-year history, while historian Turgun Almas incorporated discoveries of Tarim mummies to conclude that Uyghurs have over 6400 years of history, and the World Uyghur Congress claimed a 4,000-year history. Chinese historians however generally traced the origin of the Uyghurs to the Tiele, some to the Dingling as well as other people mentioned in ancient Chinese texts such as the Guifang. Official Chinese view asserts the Uyghurs to be of Tiele origin, and only became the main social and political force in Xinjiang during the ninth century when they migrated to Xinjiang from Mongolia after the collapse of the Uyghur Khaganate, replacing the Han Chinese that they claimed were there since the Han Dynasty. Many modern Western scholars however do not consider the modern Uyghurs to be of direct linear descent from the old Uyghur Khaganate of Mongolia, rather they are descendants of a number of people, of which the ancient Uyghurs are but one.
Yenisei Kyrgyz
The Kyrgyz Khagans of the Yenisei Kirghiz Khaganate claimed descent from the Chinese general Li Ling, grandson of the famous Han Dynasty general Li Guang. Li Ling was captured by the Xiongnu and defected in the first century BCE. And since the Tang royal Li family also claimed descent from Li Guang, the Kirghiz Khagan was therefore recognized as a member of the Tang Imperial family. Emperor Zhongzong of Tang had said to them that "Your nation and Ours are of the same ancestral clan (Zong). You are not like other foreigners."
In 758, the Uyghurs killed the Kirghiz Khan, and the Kirghiz came under the rule of the Uyghur Khaganate. However, the Yenisei Kyrghyz spent much of their time in a state of rebellion. In 840 they succeeded in sacking the Uyghur capital, Ordu-Baliq in Mongolia's Orkhon Valley, and driving the Uyghurs out of Mongolia entirely. On February 13 843 at "Kill the Foreigners" Mountain, the Tang Chinese inflicted a devastating defeat upon the Uyghur Qaghan's forces. But rather than replace the Uyghurs as the lords of Mongolia, the Yenisei Kirghiz continued to live in their traditional homeland and exist as they had for centuries. The defeat and collapse of the Uyghur Khaganate triggered a massive migration of Uyghurs from Mongolia into Turfan, Kumul, and Gansu where they founded the Kingdom of Qocho and Gansu Uyghur Kingdom.
When Genghis Khan came to power in the early 13th century, the Yenisei Kirghiz submitted peacefully to him and were absorbed into his Mongol Empire, putting an end to their independent state. During the time of the Mongol Empire, the territory of the Yenisei Kirghiz in northern Mongolia was turned into an agricultural colony called Kem-Kemchik. Kublai Khan, who founded the Yuan Dynasty, also sent Mongolian and Chinese officials (along with colonists) to serve as judges in the Kyrgyz and Tuva regions.