to Muslim people, the term refers specifically to the community of Chinese-speaking Muslims in China, who share many cultural similarities with the Han. Europeans commonly referred to these people as "Dungan" or "Tungan" during the Dungan revolt. The people referred to as "Andijanis" or "Kokandis" include the subjects of the Kokand Khanate—Uzbeks, Sarts, Southern Kyrgyzes, Ferghana Kipchaks and Tajiks. The Kokand army was predominantly formed from Uzbeks and the nomadic Kyrgyz and Kipchaks. Revolt in Gansu and Shaanxi Background The Dungan Revolt occurred partly because of ethnic antagonism and class warfare, not only because of religious strife (as is sometimes mistakenly assumed). Chinese Muslims played a major role in resisting the early Qing dynasty in the wake of its victory over the Ming. For example, in 1646, Muslim Ming loyalists in Gansu led by Milayin and Ding Guodong organized a revolt in 1646, aiming to drive the Qing out and restore as emperor the Ming Prince of Yanchang, Zhu Shichuan. The Muslim Ming loyalists were supported by Sa'id Baba, the Sultan of Hami, and the Sultan's son Prince Turumtay. Additionally, Han Chinese and Tibetans joined the Muslim Ming loyalists in the revolt. After fierce fighting and negotiations, a peace agreement was formulated in 1649. Milayin and Ding nominally pledged allegiance to the Qing, and they were given ranks as members of the Qing military. However, when the Qing withdrew their forces from Gansu to fight resurgent Ming loyalists in southern China, Milayin and Ding once again took up arms and rebelled with the support of Turumtay against the Qing. They were ultimately crushed by the Qing and 100,000 of them—including Milayin, Ding Guodong, and Turumtay—were killed in battle. Additionally, the Confucian Hui Muslim scholar Ma Zhu (1640–1710) served with the southern Ming loyalists against the Qing. During the Qianlong era (17351796), scholar Wei Shu () commented on Jiang Tong's () essay Xironglun (), stating that if the Muslims did not migrate, they would end up like the Five Hu, who overthrew the Western Jin and caused an ethnic conflict to break out between the Five Hu and the Han Chinese. During the Qianlong Emperor's reign, there were clashes between the Qing authorities and the Jahriyya Sufi sect, but not with the majority non-Sufi Sunnis or the Khafiyya Sufis. Chinese Muslims had traveled to West Asia for many years prior to the Hui Minorities' War. In the 18th century several prominent