The Dungan revolt erupted due to infighting between different Muslim Sufi sects, the Khafiya and the Jahariyya, and the Gedimu. When the rebellion failed, mass-immigration of the Dungan people into Imperial Russia, Kazakhstan and Kyrgyzstan ensued. Before the war, the population of Shaanxi province totalled approximately 13 million inhabitants, at least 1,750,000 of whom were Dungan (Hui).