 After the fall of the Uyghur Khaganate, the Uyghurs migrated south and established the Ganzhou Uyghur Kingdom in modern Gansu and the Kingdom of Qocho near modern Turpan.The Uyghurs in Qocho converted to Buddhism, and, according to Mahmud al-Kashgari, were "the strongest of the infidels" while the Ganzhou Uyghurs were conquered by the Tangut people in the 1030s.Both Tibet and the Uyghur Khanate declined in the mid-9th century.