The Uighur were an ancient confederation of Turkic tribes that united in the sixth century ("Uighur" means "union") and established a khanate south of Lake Baikal (Mongolia) in AD. 740. It maintained political and military alliances with the Tang dynasty in neighboring China. Trade and marital relations were forged as well, with Uighur princesses often marrying Chinese rulers. In 840 the Uighur Kingdom was conquered by the Kirghiz, another Turkic group. In the successive years, the original Uighur population dispersed south and west, often mixing with local populations. One group of Uighur likely became absorbed into the Chinese Empire, whereas another migrated south to became directly antecedent to the Yugur (Yellow Uighur) of China's Gansu Province.
Many Uighur migrated southwest to the desert-oasis regions north of the Tarim Basin (Xinjiang Province, China). Near Turfan and Kucha they reestablished a kingdom increasingly based on agriculture and trade. Even as its political power declined, art, music, and religion flourished. Uighur established a new script based on the Sogdian writing system (an old Iranian dialect). Buddhism was adopted, along with Nestorian Christianity and Zoroastrianism, but the original state religion of Manicheanism was maintained.
Some Turkic groups, among them possibly Uighur, settled among the indigenous Iranian population in the Kashgar oasis region, southwest of the Tarim Basin. This area became absorbed into the Islamicized Kharakhanid domain during the tenth to thirteenth centuries. Kashgar became an important Islamic center of learning, influenced by Arabic and Persian civilizations.
In the early thirteenth century, the Buddhist Uighur Kingdom to the north voluntarily submitted to Chinggis (Genghis) Khan's rule. Uighur administrators, advisers, and accountants subsequently became influential in the Mongol Empire. During the Chagatay dynasty ruled by Chinggis's offspring (mid-thirteenth century), the entire Tarim Basin area became united and absorbed under the Islamic aegis. The Uighur name, but not its script or language, virtually disappeared for approximately 500 years. Inhabitants of this oasis region, now known as China's Xinjiang Province (formerly Eastern Turkistan), called themselves according to local or regional affiliations: "Turfanlik" (person of Turfan), "Kashgarlik," "Aqsulik," "Yarkandlik," and "Khotanlik," among others. Alternately, they were known by occupation: "Taranchi" (farmer) or "Sart" (merchant). In the 1600s the Chinese Empire established control of Eastern Turkistan during the Qing (Manchu) dynasty. During rebellions against the Qing in the 1860s, several independent khanates were briefly formed. In 1881 the czarist government annexed the Hi region along the Sino-Russian border from the weakened Qing government. When the Ili region was returned to China after ten years, thousands of inhabitants of Eastern Turkistan migrated across the Russian border. The czarist government offered them citizenship, land, and exemption from taxes for ten years. In 1921, during the establishment of the multinational Soviet state, the Uighur name was revived to unite Kashgarlik, Taranchi, and others into a single ethnic identity.