By the 1860s,
Xinjiang had been under
Qing rule for a century. The area had been conquered in 1759 from the
Dzungar Khanate whose core population, the
Oirats, subsequently became the targets of genocide. However, Xinjiang consisted mostly of semi-arid or desert lands, which were not attractive to potential
Han settlers aside from a few traders. Consequently, Turkic peoples such as the Uyghurs settled in the area instead. The Uyghurs were not known by their present name until the early 20th century. The
Uzbeks that dwelled close to present-day Xinjiang were collectively called "
Andijanis" or "
Kokandis", while the Uyghurs in the
Tarim Basin were known as "Turki", likely due to
their Turkic language. There were also Uyghur immigrants residing in the Ili area who were called "
Taranchi". The modern term "Uyghur" was assigned to the Turki by the then newly created
Soviet Union in 1921 at a conference in
Tashkent. As a result, sources from the period of the Dungan Revolt make no mentions of Uyghurs. The conflict was mainly an ethnic and religious war fought by Muslims (particularly
Hui) in China's Xinjiang,
Shaanxi,
Ningxia and
Gansu provinces, from 1862 to 1877. Thousands of Muslim refugees from Shaanxi fled to Gansu. Some of them formed significant battalions in eastern Gansu, intending to reconquer their lands in Shaanxi. While the Hui rebels were preparing to attack Gansu and Shaanxi,
Yakub Beg, an ethnic Uzbek or
Tajik commander from the
Kokand Khanate, fled from the Khanate in 1865 after losing
Tashkent to the
Russians, settled in Kashgar, and soon managed to take complete control of the oasis towns surrounding the
Tarim Basin in southern
Xinjiang. ==Yakub Beg==