In 1644, after peasant rebels sacked the Ming dynasty's capital of Beijing, the Jurchens (now called Manchus) allied with Ming general Wu Sangui and seized control of Beijing, overthrowing the short-lived Shun dynasty (1644-1649) and establishing Qing-dynasty rule (1644–1912) over all of China.