[[File:Man of Gaochang (高昌國, Turfan) in 番客入朝圖 (937-976 CE).jpg|thumb|Man of Gaochang (高昌國, Turfan) in "Entrance of the foreign visitors" (番客入朝圖) (937–976 CE)]] Qocho or Kara-Khoja (), also known as Idiqut, ("holy wealth"; "glory"; "lord of fortune") was a Uyghur kingdom created in 843, with strong Chinese Buddhist and Tocharian influences. It was founded by Uyghur refugees fleeing the destruction of the Uyghur Khaganate after being driven out by the Yenisei Kirghiz. They made their summer capital in Qocho (also called Gaochang or Qara-Khoja, near modern Turpan) and winter capital in Beshbalik (modern Jimsar County, also known as Tingzhou). Its population is referred to as the "Xizhou Uyghurs" after the old Tang Chinese name for Gaochang, the Qocho Uyghurs after their capital, the Kucha Uyghurs after another city they controlled, or the Arslan (lion) Uyghurs after their king's title.
Timeline
In 843, a group of Uyghurs migrated southward under the leadership of Pangtele, and occupied Karasahr and Kucha, taking them from the Tibetan Empire.
In 856, this group of Uyghurs received royal recognition from the Tang dynasty. At this time, their capital was in Karasahr (Yanqi).
In 866, Pugu Jun declared himself khan and adopted the title of idiqut. The Kingdom of Qocho captured Xizhou (Gaochang), Tingzhou (Beshbalik, or Beiting), Changbaliq (near Ürümqi) and Luntai (Bugur) from the Guiyi Circuit. The Uyghur capital was moved to Xizhou (Gaochang/Qocho), which the Uyghurs called Idiqutshari. Beshbalik became their summer residence.
In 869 and 870 the Kingdom of Qocho attacked the Guiyi Circuit but was repelled. In 876 the Kingdom of Qocho seized Yizhou from the Guiyi Circuit. In 880, Qocho attacked Shazhou (Dunhuang) but was repelled. By 887, they were settled under an agrarian lifestyle in Qocho.
In 904, Zhang Chengfeng of the Guiyi Circuit attacked Qocho and seized Yizhou (Hami/Kumul) and Xizhou (Gaochang). This occupation ended after the Jinshan Kingdom's loss to the Ganzhou Uyghur Kingdom in 911. In 954, Ilig Bilgä Tengri rose to power. In 981, Arslan Bilgä Tengri ilig rose to power. 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." The addition of the title "Nephew" (外甥) was intended as a show of sincerity to the people of China's Central Plains, as "nephew" referred to the traditional relationship between the Uyghur Khans and the previous Tang dynasty who referred to each other as uncle and nephew. Meanwhile, West Prefecture (西州) referred to Qocho's designation under Tang administration. In 984, Arslan Bilgä Tengri ilig became Süngülüg Khagan. In the same year, a Song dynasty envoy reached Qocho and gave an account of the city:
In 996, Bügü Bilgä Tengri ilig succeeded Süngülüg Khagan.
In 1007, Alp Arsla Qutlugh Kül Bilgä Tengri Khan succeeded Bügü Bilgä Tengri ilig. In 1008, Manichaean temples were converted to Buddhist temples. In 1024, Kül Bilgä Tengri Khan succeeded Alp Arsla Qutlugh Kül Bilgä Tengri Khan. In 1068, Tengri Bügü il Bilgä Arslan Tengri Uighur Tärkän succeeded Kül Bilgä Tengri Khan. By 1096, Qocho had lost Aksu, Tumshuk, and Kucha to the Karakhanids.
In 1123, Bilgä rose to power. He was succeeded by Yur Temur at some point. In 1128, the Kingdom of Qocho became a vassal of the Qara Khitai.
In 1209, the Kingdom of Qocho became a vassal of the Mongol Empire.
In 1229, Barčuq Art iduq-qut succeeded Yur Temur. In, 1242 Kesmez iduq-qut succeeded Barčuq Art iduq-qut. In 1246, Salïndï Tigin iduq-qut succeeded Kesmez iduq-qut. In 1253, Ögrünch Tigin iduq-qut succeeded Salïndï Tigin iduq-qut. In, 1257 Mamuraq Tigin iduq-qut succeeded Ögrünch Tigin iduq-qut, who was executed for supporting the Ogodeid branch of the Genghisid family. In 1266, Qosqar Tigin iduq-qut succeeded Mamuraq Tigin iduq-qut. In 1280, Negüril Tigin iduq-qut succeeded Qosqar Tigin iduq-qut.
In 1318, Negüril Tigin iduq-qut died. Later, the Kingdom of Qocho became part of the Chagatai Khanate. In 1322, Tämir Buqa iduq-qut rose to power. In 1330, Senggi iduq-qut succeeded Tämir Buqa iduq-qut. In 1332, Taipindu iduq-qut succeeded Senggi iduq-qut. In 1352, Ching Timür iduq-qut succeeded Taipindu iduq-qut and was the last known ruler governor of the kingdom. By the 1370s, the Kingdom of Qocho ceased to exist.