The
Uyghurs established a Kingdom in Turpan (known as the Uyghuria Idikut state or Kara-Khoja Uyghur Idikut Kingdom) that lasted from 856 to 1389 AD, surviving as a vassal of the
Mongol Empire. This Kingdom, led by Idikuts, or Saint Spiritual Rulers, was established after the fall of the
Uyghur Empire to the
Kyrgyz Turks. Last Idikut left Turpan area in 1284 for
Kumul, then
Gansu to seek protection of
Yuan Dynasty, but local uyghur Buddhist rulers still held power until Invasion of
Moghul Hizir Khoja in 1389. Convertion local buddhist population to Islam was completed nevertheless only in the last half of XV century.
...
A branch of the
Uyghurs migrated to oasis settlements of
Tarim Basin and
Gansu, such as
Gaochang (Khoja) and Hami (
Kumul) and set up a confederation of decentralized Buddhist states called
Kara-Khoja. Others, occupying western Tarim Basin,
Ferghana Valley,
Jungaria and parts of
Kazakhstan bordering the Muslim Khwarazm Sultanate, converted to Islam no later than 10th century and built a federation with Muslim institutions called Kara-Khanlik, whose princely dynasties are called Kara-Khanids by historians.