There was a pre-existing community of Uyghurs at Gan Prefecture by 840 at the very latest. Around the years 881 and 882, Gan Prefecture slipped from the control of the Guiyi Circuit. In 894 the Uyghurs established the Ganzhou Uyghur Kingdom in Gan Prefecture. In 910 the Ganzhou Uyghurs attacked the Kingdom of Jinshan. In 911 the Ganzhou Uyghurs attacked the Kingdom of Jinshan and forced them into an alliance as a lesser partner. In 916 a Ganzhou Uyghur princess was married to Cao Yijin, governor of the Guiyi Circuit. In 920 Huaijian Khagan became sickly. In 924 Huaijian Khagan died and his sons Diyin and Renmei fought over the throne with Diyin coming outon top. In 925 Cao Yijin led an attack on the Ganzhou Uyghurs and defeated them. In 926 Diyin died and Aduoyu succeeded him as Shunhua Khagan. Shunhua Khagan married Cao Yijin's daughter. In 930 Cao Yijin visited the Ganzhou Uyghur court in Gan Prefecture. In 933 Shunhua Khagan died and Jingqiong succeeded him. In 961 the Ganzhou Uyghurs accepted the Song dynasty as suzerains. In 975 Jingqiong died and Yeluohe Mili'e succeeded him. In 983 Jingqiong died and Lusheng succeeded him. In 1003 Lusheng died and Zhongshun Baode Khagan succeeded him. The Tanguts attacked the Ganzhou Uyghurs but were defeated. In 1008 the Ganzhou Uyghurs and Tanguts engaged in combat and the Uyghurs emerged victorious. The Liao dynasty attacked the Ganzhou Uyghurs and defeated them. In 1009 the Ganzhou Uyghurs captured Liang Prefecture. In 1010 the Liao dynasty attacked the Ganzhou Uyghurs and defeated them. In 1016 Zhongshun Baode Khagan died and Huaining Shunhua Khagan succeeded him. In 1023 Huaining Shunhua Khagan died and Guizhong Baoshun Khagan succeeded him. In 1026 the Ganzhou Uyghurs were defeated in battle by the Liao dynasty. In 1028 the Ganhzhou Uyghurs were defeated by the Tanguts. Guizhong Baoshun Khagan died and Baoguo Khagan succeeded him. In 1036 the Ganzhou Uyghur Kingdom was annexed by the Tanguts. After the destruction of their realm, the Ganzhou Uyghurs migrated west and settled between Dunhuang and the Qaidam Basin, where they came be known as the Yellow Head Uyghurs. They practiced Buddhism and lived as pastoral nomads. Their descendants are today known as the Yugurs.
Modern era
The modern day descendants of the Ganzhou Uyghurs are known as the Yugur.