In 840, after the Uyghur Khanate in Mongolia had been conquered by the Kirghiz, Uyghurs migrated southwards into the Tarim Basin, to Kara-khoja and to Beshbalik near today's Turpan and Urumqi. They formed the Western Uyghur Kingdom Qocho (Kara-Khoja Kingdom), which remained in eastern Xinjiang until the 14th century, though it was subject to various overlords during that time, including the Karakhanid. The Uyghur state in eastern Xinjiang was initially Manicheaean, but later converted to Buddhism. Analysis of Tarim mummies confirms that Turkic-speaking Uighur began migrating to the region by the 9th century (842 CE) from Central Asia.