The rise of the Qing dynasty saw numerous Islamic rebellions, including the Panthay Rebellion which occurred in Yunnan from 1855 to 1873, and the Dungan Revolt, which occurred mostly in Xinjiang, Shaanxi and Gansu from 1862 to 1877. The Manchu government ordered the execution of all rebels, killing a million Muslims after the Panthay Rebellion, and several million after the Dungan Revolt. However, many Muslims like Ma Zhan'ao, Ma Anliang, Dong Fuxiang, Ma Qianling and Ma Julung, defected to the Qing dynasty side and helped the Qing general Zuo Zongtang to exterminate the rebels. These Muslim generals belonged to the "Khufiyya" sect, while rebels belonged to the "Jahariyya" sect. In 1895, another Dungan Revolt (1895–96) broke out, and loyalist Muslims like Dong Fuxiang, Ma Anliang, Ma Guoliang, Ma Fulu, and Ma Fuxiang massacred the rebel Muslims led by Ma Dahan, Ma Yonglin, and Ma Wanfu. A few years later, an Islamic army called the Kansu Braves, led by the general Dong Fuxiang, fought for the Qing dynasty against the foreigners during the Boxer Rebellion.