these kingdoms never recovered from Tang rule after thousands of their inhabitants were killed during the conquest. The settled population of these cities later merged with the incoming Turkic people, including the Uyghurs of Uyghur Khaganate, to form the modern Uyghurs. The Indo-European Tocharian language later disappeared as the urban population switched to a Turkic language such as the Old Uyghur language. The early Turkic peoples descended from agricultural communities in Northeast Asia who moved westwards into Mongolia in the late 3rd millennium BC, where they adopted a pastoral lifestyle. By the early 1st millennium BC, these peoples had become equestrian nomads. In subsequent centuries, the steppe populations of Central Asia appear to have been progressively Turkified by East Asian nomadic Turks, moving out of Mongolia. Uyghur Khaganate (8th–9th centuries) The Uyghurs of the Uyghur Khaganate were part of a Turkic confederation called the Tiele, who lived in the valleys south of Lake Baikal and around the Yenisei River. They overthrew the First Turkic Khaganate and established the Uyghur Khaganate. The Uyghur Khaganate lasted from 744 to 840. It was administered from the imperial capital Ordu-Baliq, one of the biggest ancient cities built in Mongolia. In 840, following a famine and civil war, the Uyghur Khaganate was overrun by the Yenisei Kirghiz, another Turkic people. As a result, the majority of tribal groups formerly under Uyghur control dispersed and moved out of Mongolia. Uyghur kingdoms (9th–11th centuries) The Uyghurs who founded the Uyghur Khaganate dispersed after the fall of the Khaganate, to live among the Karluks and to places such as Jimsar, Turpan and Gansu. These Uyghurs soon founded two kingdoms and the easternmost state was the Ganzhou Kingdom (870–1036) which ruled parts of Xinjiang, with its capital near present-day Zhangye, Gansu, China. The modern Yugurs are believed to be descendants of these Uyghurs. Ganzhou was absorbed by the Western Xia in 1036. The second Uyghur kingdom, the Kingdom of Qocho ruled a larger section of Xinjiang, also known as Uyghuristan in its later period, was founded in the Turpan area with its capital in Qocho (modern Gaochang) and Beshbalik. The Kingdom of Qocho lasted from the ninth to the fourteenth century and proved to be longer-lasting than any power in the region, before or since. The Uyghurs were originally Tengrists, shamanists, and Manichaean, but converted to Buddhism during this period. Qocho accepted the Qara Khitai as its overlord in