[[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.
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, after which it came to be called Kumul. 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.