stylistic:style_transfer, information:extraction
Rebellion, invasion, collapse

A peasant soldier named Li Zicheng mutinied with his fellow soldiers in western Shaanxi in the early 1630s after the Ming government failed to ship much-needed supplies there. In 1634 he was captured by a Ming general and released only on the terms that he return to service. The agreement soon broke down when a local magistrate had thirty-six of his fellow rebels executed; Li's troops retaliated by killing the officials and continued to lead a rebellion based in Rongyang, central Henan province by 1635. By the 1640s, an ex-soldier and rival to Li— Zhang Xianzhong (1606–1647)—had created a firm rebel base in Chengdu, Sichuan, with the establishment of the Xi dynasty, while Li's center of power was in Hubei with extended influence over Shaanxi and Henan.

In 1640, masses of Chinese peasants who were starving, unable to pay their taxes, and no longer in fear of the frequently defeated Chinese army, began to form into huge bands of rebels. The Chinese military, caught between fruitless efforts to defeat the Manchu raiders from the north and huge peasant revolts in the provinces, essentially fell apart. Unpaid and unfed, the army was defeated by Li Zicheng—now self-styled as the Prince of Shun —and deserted the capital without much of a fight. On 25 April 1644, Beijing fell to a rebel army led by Li Zicheng when the city gates were opened by rebel allies from within. During the turmoil, Chongzhen, the last Ming emperor, accompanied only by a eunuch servant, hanged himself on a tree in the imperial garden right outside the Forbidden City.

Seizing opportunity, the Eight Banners crossed the Great Wall after the Ming border general Wu Sangui (1612–1678) opened the gates at Shanhai Pass. This occurred shortly after he learned about the fate of the capital and an army of Li Zicheng marching towards him; weighing his options of alliance, he decided to side with the Manchus. The Eight Banners under the Manchu Prince Dorgon (1612–1650) and Wu Sangui approached Beijing after the army sent by Li was destroyed at Shanhaiguan; the Prince of Shun's army fled the capital on the fourth of June. On 6 June, the Manchus and Wu entered the capital and proclaimed the young Shunzhi Emperor ruler of China. After being forced out of Xi'an by the Qing, chased along the Han River to Wuchang, and finally along the northern border of Jiangxi province, Li Zicheng died there in the summer of 1645, thus ending the Shun dynasty. One report says his death was a suicide; another states that he was beaten to death by peasants after he was caught stealing their food.

Despite the loss of Beijing and the death of the emperor, the Ming were not yet totally destroyed. Nanjing, Fujian, Guangdong, Shanxi, and Yunnan were all strongholds of Ming resistance. However, there were several pretenders for the Ming throne, and their forces were divided. These scattered Ming remnants in southern China after 1644 were collectively designated by 19th-century historians as the Southern Ming. Each bastion of resistance was individually defeated by the Qing until 1662, when the last Southern Ming emperor, Zhu Youlang, the Yongli Emperor, was captured and executed. Despite the Ming defeat, smaller loyalist movements continued until the proclamation of the Republic of China.