Turkic settlement of the Tarim Basin
Turkic peoples began settling in the Tarim Basin in the 7th century. The area was later settled by the Uyghur people, who founded the Qocho Kingdom there in the 9th century.[1] The historical area of what is modern-day Xinjiang consisted of the distinct areas of the Tarim Basin (also known as Altishahr) and Dzungaria. The area was first populated by Indo-European Tocharian and Saka peoples, who practiced Buddhism. The Tocharian and Saka peoples came under Xiongnu[2][3][4][5][6] and then Chinese rule during the Han dynasty as the Protectorate of the Western Regions due to wars between the Han dynasty and the Xiongnu. The First Turkic Khaganate conquered this region in 560, and in 603 after a series of civil wars the First Turkic Khaganate was separated into the Eastern Turkic Khaganate and the Western Turkic Khaganate, with Xinjiang coming under the Western Turkic Khaganate.[7] The region then became part of the Tang dynasty as the Protectorate General to Pacify the West after the Tang campaigns against the Western Turks. The Tang dynasty withdrew its control of the region in the Protectorate General to Pacify the West and the Four Garrisons of Anxi after the An Lushan Rebellion, after which the Turkic peoples and the other native inhabitants living in the area gradually converted to Islam.