Xinjiang consists of two main regions, geographically separated by the Tianshan Mountains, which are historically and ethnically distinct: Dzungaria to the north, and the Tarim Basin (currently mainly inhabited by the Uyghurs) to the south. In the 18th and 19th centuries, these areas were conquered by the Qing dynasty, which in 1884 integrated them into one province named Xinjiang ().

The first inhabitants of Xinjiang, specifically from southern and western Xinjiang, formed from admixture between locals of Ancient North Eurasian and Northeast Asian descent. The oldest mummies found in the Tarim Basin are dated to the 2nd millennium BCE. In the first millennium BCE Indo-European-speaking Yuezhi nomads migrated into parts of Xinjiang. In the second century BCE the region became part of the Xiongnu Empire, a confederation of nomads centered on present-day Mongolia, which forced the Yuezhi out of Xinjiang.

Eastern Central Asia was referred to as "Xiyu" () under the control of the Han dynasty, to whom the Xiongnu surrendered in 60 BCE following the Han–Xiongnu War, and which maintained a variable military presence until the early 3rd century CE. From the 2nd to the 5th century, local rulers controlled the region. In the 6th century, the First Turkic Khaganate was established. In the 7th-8th century, the Tang dynasty, Turks, and Tibetans warred for control, and the Tang dynasty established the Anxi Protectorate and the Beiting Protectorate in Xinjiang and part of Central Asia.

This was followed by the Uyghur Khaganate in the 8th-9th century. Uyghur power declined, and three main regional kingdoms vied for power around Xinjiang, namely the Buddhist Uyghur Kara-Khoja, the Turkic Muslim Kara-Khanid, and the Iranian Buddhist Khotan. Eventually, the Turkic Muslim Kara-Khanids prevailed and Islamized the region. In the 13th century it was part of the Mongol Empire, after which the Turkic people again prevailed. It was dominated by the Oirat Mongol-speaking Dzungar Khanate in the late 17th century.

In the 18th century, during the Dzungar–Qing Wars, the area was conquered by the Manchu Qing dynasty. After the Dungan Revolt (1862–1877), the area was reconquered by the Qing, who established the Xinjiang Province in 1884. It is now a part of the People's Republic of China.

Etymology

Xinjiang consists of two main geographically, historically, and ethnically distinct regions with different historical names: Junggar Basin (Dzungaria) north of the Tianshan Mountains; and the Tarim Basin (Southern Xinjiang) south of the Tianshan Mountains.

In ancient China, the Tarim Basin was known as "Xiyu" or "Western Regions", a name that became prevalent in Chinese records after the Han dynasty took control of the region in the 2nd century BCE.Fairbank, K. John. The Cambridge History of China. Cambridge University Press. 1978. p. 269. . It soon was traversed by the Northern Silk Road.

For the Uyghurs, who took control of northern Xinjiang in the 8th century, the traditional name of the Tarim Basin in southern Xinjiang was Altishahr, which means "six cities" in the Uyghur language. The region of Dzungaria in northern Xinjiang was named after its native inhabitants, the Dzungar Mongols.

In 1759 the Qing China conquered the region, which became known as "Xiyu Xinjiang" () or simply Xinjiang (), although Europeans commonly used the name "Chinese Turkestan" at the time to refer to the Tarim Basin in Southern Xinjiang (sometimes Xinjiang as a whole). Meanwhile, Russian Sinologist Nikita Bichurin coined the name "East Turkestan" (along with the name "West Turkestan", also known as Russian Turkestan) in 1829 intending to replace the European term "Chinese Turkestan", also being used to refer to the Tarim Basin.

In 1884 Qing China took over the state of Yettishar (or Kashgaria, created during the Dungan Revolt) and established the Xinjiang Province. In the late 19th century, there was a proposal to restore the old administration of Xinjiang into two provinces, the areas north and south of Tianshan (which was however not adopted).

Ethnic identity

At the time of the Qing conquest in 1759, Dzungaria was mostly inhabited by the Oirat Mongol-speaking Dzungar people, while the Tarim Basin was inhabited by sedentary Muslim Uyghur people. They were governed separately until 1884.

The Qing dynasty was well aware of the differences between the former Buddhist-Mongol area to the north of the Tianshan mountains and Turkic-Muslim area south of the Tianshan, and ruled them in separate administrative units at first. However, Qing bureaucracy began to think of both areas as part of one distinct region called Xinjiang. The very concept of Xinjiang as one distinct geographic identity was created by the Qing, and it was originally not the native inhabitants who viewed it that way. During Qing rule, there was not much sense of "regional identity" held by ordinary Xinjiang people. Rather, Xinjiang's distinct identity was given by the Qing. It had a distinct geography, history, and culture from the rest of Qing China, while at the same was still Chinese territory, settled by the Han and Hui ethnic groups, distinct from the rest of Central Asia, and largely multicultural.

Genetic studies The earliest Tarim Basin people of southern and western Xinjiang appear to have arisen from a mixture between locals of Ancient North Eurasian and Northeast Asians descent. The Tarim mummies have been found in various locations in the western Tarim Basin such as Loulan, the Xiaohe Tomb complex, and Qäwrighul. These mummies have been previously suggested to be of Tocharian origin, but recent evidence suggest that the mummies belonged to a distinct population unrelated to Indo-European pastoralists, such as Afanasievo. .

Ancient as well as modern Uyghurs display variable degrees of East Eurasian and West Eurasian ancestry. James A. Millward described the original Uyghurs as physically East Eurasian, giving as an example the images in the Bezeklik Caves at temple 9, of the Uyghur patrons, until they began to mix with the Tarim Basin's inhabitants. However, a genetic study of early Uyghur remains from the core of the Uyghur Khaganate in Orkhon Valley, Mongolia said that the Uyghurs were mostly of West Eurasian ancestry, being modelled as genetically similar to the Iranian Alan and Sarmatian people, with significant East Eurasian admixture. The east–west admixture in the Uyghur Khaganate was said to have taken place around the year 500 AD. See figure 4. "The high genetic heterogeneity of the Early Medieval period is vividly exemplified by 12 individuals from the Uyghur period cemetery of Olon Dov (OLN; Figure 2) in the vicinity of the Uyghur capital of Ordu-Baliq. Six of these individuals came from a single tomb (grave 19), of whom only two are related (OLN002 and OLN003, second-degree; Table S2D); the absence of closer kinship ties raises questions about the function of such tombs and the social relationships of those buried within them. Most Uyghur-period individuals exhibit a high but variable degree of west Eurasian ancestry—best modeled as a mixture of Alans, a historic nomadic pastoral group likely descended from the Sarmatians and contemporaries of the Huns (Bachrach, 1973), and an Iranian-related (BMAC-related) ancestry—together with Ulaanzuukh_SlabGrave (ANA-related) ancestry (Figure 3E). The admixture dates estimated for the ancient Türkic and Uyghur individuals in this study correspond to ca. 500 CE: 8 ± 2 generations before the Türkic individuals and 12 ± 2 generations before the Uyghur individuals (represented by ZAA001 and Olon Dov individuals)."

One study by Xu et al. (2008), using samples from Hetian (Hotan) only, found Uyghurs have about an average of 60% European or West Asian (Western Eurasian) ancestry and about 40% East Asian or Siberian ancestry (Eastern Eurasian). From the same area, it is found that the proportion of Uyghur individuals with European/West Asian ancestry ranges individually from 40.3% to 84.3% while their East Asian/Siberian ancestry ranges individually from 15.7% to 59.7%. Li et al. (2010) analyzed the remains of Xiaohe individuals found at the Xiaohe Tomb complex (2nd millennium BCE) for Y-DNA and mtDNA markers. The study found that while Y-DNA corresponded to ancient Siberian populations, the mtDNA haplotypes were an admixture of East Asian and European origin. The initial admixture may have taken place in Southern Siberia, which was settled by the Indo-European Andronovo and Afanasievo cultures, as well as Paleo-Siberian cultures.

A study by Li et al. used a larger sample of individuals from a wider area and found a higher East Asian component of about 70% on average, while the European/West Asian component was about 30%. Overall, Uyghurs show relative more similarity to "Western East Asians" than to "Eastern East Asians". The authors also cite anthropologic studies which also estimate about 30% "Western proportions", which are in agreement with their genetic results. They summarized their study evidence: "In conclusion, we argue that the Uyghurs' genetic structure is more similar to East Asians than to Europeans".

Local inhabitants at Sampul cemetery (Shanpula; ) around , from the archaeological site of Hotan in Lop County, where art such as the Sampul tapestry has been found, buried their dead from roughly 217 BCE to 283 CE. The analysis of mtDNA haplogroup distribution showed that the Sampula inhabitants had a large mixture of East Asian, Persian and European characteristics. According to Chengzhi et al. (2007), analysis of maternal mitochondrial DNA of the human remains has revealed genetic affinities at the maternal side to Ossetians and Iranians, an Eastern-Mediterranean paternal lineage.

Early inhabitants (2nd–1st millennium BCE)

Tarim mummies

A series of mummified human remains have been discovered in Xinjiang, owing to the extremely dry local climate. These cultures span the Bronze Age and Iron Age periods. Due to the West Eurasian appearance of many of the mummies, as well as their exotic material culture, there has been considerable linguistic and genetic research in to their origin.

The well-preserved Tarim mummies of southern and western Xinjiang show evidence of population admixture. Between 2009 and 2015, the remains of 92 individuals found at the Xiaohe Tomb complex were analyzed for Y-DNA and mtDNA markers. Genetic analyses of the mummies showed that the maternal lineages of the Xiaohe people originated from both East Asia and West Eurasia, whereas the paternal lineages all originated from West Eurasia. The Tarim mummies have been found in various locations in the western Tarim Basin such as Loulan, and Qäwrighul.

The Shan Hai Jing (4th-2nd century BCE) describes the existence of "white people with long hair" or Bai (), who lived beyond the northwestern border. These are thought to have referred to the Yuezhi people. According to J. P. Mallory and Victor H. Mair, "[s]uch a description could accord well with a Caucasoid population beyond the frontiers of Ancient China," possibly the Yuezhi.: "The strange creatures of the Shanhai jing: [...] we find recorded north of the territory of the "fish dragons" the land of the whites (Bai), whose bodies are white and whose long hair falls on their shoulders. Such a description could accord well with a Caucasoid population beyond the frontiers of Ancient China and some scholars have identified these Whites as Yuezhi."