When the Qing dynasty invaded the Ming dynasty in 1644, Muslim Ming loyalists led by Muslim leaders Milayin, Ding Guodong, and Ma Shouying led a revolt in 1646 against the Qing during the Milayin rebellion in order to drive the Qing out and restore the Ming Prince of Yanchang Zhu Shichuan to the throne as the emperor. The Muslim Ming loyalists were crushed by the Qing with 100,000 of them, including Milayin and Ding Guodong, killed.