The Dungan Revolt (1862–1877) or Tongzhi Hui Revolt (, Xiao'erjing: تُجِ خُوِ لُوًا, Тунҗы Хуэй Луан) or Hui (Muslim) Minorities War was a war fought in 19th-century western China, mostly during the reign of the Tongzhi Emperor (r. 1861–1875) of the Qing dynasty. The term sometimes includes the Panthay Rebellion in Yunnan, which occurred during the same period. However, this article refers specifically to two waves of uprising by various Chinese Muslims, mostly Hui people, in Shaanxi, Gansu and Ningxia provinces in the first wave, and then in Xinjiang in the second wave, between 1862 and 1877. The uprising was eventually suppressed by Qing forces led by Zuo Zongtang.
The conflict began with riots by the Hui and massacres of the Han Chinese, followed by the revenge massacres of the Hui by the Han. It resulted in massive demographic shifts in Northwest China, and led to a population loss of 21 million people from a combination of massacres, migration, famine, and corpse-transmitted plague. Due to the conflict, Gansu lost 74.5% (14.55 million) of its population, Shaanxi lost 44.6% (6.2 million) of its population, and Northern Xinjiang lost 72.6% (0.34 million) of its population. The population reduction of Hui in Shaanxi was particularly severe. According to research by modern historians, at least 4 million Hui were in Shaanxi before the revolt, but only 20,000 remained in the province afterwards, with most of the Hui either killed in massacres and reprisals by government and militia forces, or deported out of the province. For example, on one occasion where 700,000 to 800,000 Hui from Shaanxi were deported to Gansu, most were killed along the way from thirst, starvation, and massacres by the militia escorting them, with only a few thousand surviving. Large numbers of Han people were also relocated to Inner Mongolia after the war. Modern Ningxia and eastern Qinghai regions such as Xining, Hualong and Xunhua used to be a part of Gansu province before the 20th century.