In 843, a group of Uyghurs migrated southward under the leadership of Pangtele, and occupied Karasahr and Kucha, taking them from the Tibetan Empire.
The Kingdom of Qocho captured Xizhou (Gaochang), Tingzhou (Beshbalik, or Beiting), Changbaliq (near Ürümqi) and Luntai (Bugur) from the Guiyi Circuit.
In 904, Zhang Chengfeng of the Guiyi Circuit (later renamed Jinshan Kingdom) attacked Qocho and seized Yizhou (Hami/Kumul) and Xizhou (Gaochang).
[11] From 981, the Idiqut of Qocho sent tribute missions to the Song dynasty under the title "Nephew Lion King Arslan Khan of the West Prefecture."
[11] In the same year, a Song Chinese envoy reached Qocho and gave an account of the city: There is no rain or snow here and it is extremely hot.
The temples house copies of the Buddhist scriptures (da zang jing) and the dictionaries Tang yun, Yupian and Jingyun.
There's an "Imperial Writings Tower' which houses edicts written by the Tang emperor Taizong kept carefully secured.
[22] In 1128, during the reign of Bilge Tekin, the Uighur Kingdom became a vassal state of the Western Liao established by the Khitan.
In 1209, the Uighur Iduq-qut ("Lord of happiness") Barchuk Art Tegin ordered the death of the Khitan magistrate (shangjian) in an attempt to free his people from the rule of the Western Liao.
[26] During the rule of the Qocho Kingdom, some of their subjects also began adopting Islam, as evident when the Idiqut threatened to retaliate against the Muslims of his lands and "destroy the mosques" if Manichaeans were persecuted in neighbouring Khorasan.
He emphasized that Muslims in Qocho were "more numerous" than Manichaeans under Islamic rule, and he was ultimately successful in staying the persecutions in Khorasan.
This episode was recorded by Arab bibliographer Ibn Al-Nadim, although he referred to the Qocho Idiqut as the "King of China".
When Al-Muqtadir (r. 908–932) of the Abbasid Caliphate began persecuting Manichaeans in what is now Iraq, the ruler of Qocho sent a letter to Nasr II of the Samanid Empire threatening to retaliate against Muslims in his realm.
A decree discovered in Turpan reports that Manichaean clerics lived in great comfort, possessed estates with serfs and slaves, ate fine food, and wore expensive garments.
The document details a dramatized dialogue between Mani and a prince, and testifies to the rich cultural life of the Qocho kingdom.
It was written that "In Qocho city were more than fifty monasteries, all titles of which are granted by the emperors of the Tang dynasty, which keep many Buddhist texts as the Tripiṭaka, Tangyun, Yupuan, Jingyin etc.
[33] While Persian monks still maintained a Manichaean temple in the kingdom, there was continued respect for Tang dynasty legacies and Buddhism.
Indeed, the 10th century Persian geography book Hudud al-'Alam called Qocho, the capital city, "Chinese town".
[34] James A. Millward claimed that the Uyghurs were generally "Mongoloid" (a term meaning "appearing ethnically Eastern or Inner Asian"), giving as an example the images of Uyghur patrons of Buddhism in Bezeklik, temple 9, until they began to mix with the Tarim Basin's original, Indo-European-speaking "Caucasoid" inhabitants,[35] such as the so-called Tocharians.
[38] The Idiquts (the title of the Qocho rulers) ruled independently until they become a vassal state of the Qara Khitai (Chinese: "Western Liao").
[41][42][43] While al-Kashgari displayed a different attitude towards the Turk diviners beliefs and "national customs", he expressed towards Buddhism a hatred in his Diwan where he wrote the verse cycle on the war against Uyghur Buddhists.
[50] The Kara-Khanid Khanate's ruler Sultan Satuq Bughra Khan razed Qocho's Buddhist temples in the Minglaq province across the Ili region.
[51][52][53][54] Buddhist murals at the Bezeklik Thousand Buddha Caves were damaged by local Muslim population whose religion proscribed figurative images of sentient beings, the eyes and mouths in particular were often gouged out.
[63] It is possible the Muslims drove some Uyghur Buddhist monks towards taking asylum in the Tangut Western Xia dynasty.
[14]In 1209, the Kara-Khoja ruler Baurchuk Art Tekin declared his allegiance to the Mongols under Genghis Khan and the kingdom existed as a vassal state until 1335.
[69] The last Buddhist Uyghurs of Qocho and Turpan were converted to Islam by force during a Jihad (holy war) at the hands of the Chagatai Khanate ruler Khizr Khoja (r.
[70] Mirza Haidar Dughlat's Tarikh-i-Rashidi (c. 1540, in Persian) wrote, "(Khizr Khoja) undertook a campaign against Karakhodja [Qocho] and Turfan, two very important towns in China, and forced their inhabitants to become Muslims".
The Encyclopaedia of Islam wrote "By then the Turks of the Turfan ... forgetting all the other highlights of their past, they attributed the Buddhist and other monuments to the 'infidel Kalmuks'.
[80] Cherrypicking of history of Xinjiang with the intention of projecting an image of either irreligiosity or piousness of Islam in Uyghur culture has been done for various reasons.
[82][83] (Tokhara Yabghus, Turk Shahis) The Kingdom of Qocho's rulers trace their lineage to Qutlugh of the Ediz dynasty of the Uyghur Khaganate.