The Qing Dynasty ruled China from 1644 to 1912. It was established by the Manchu people who invaded from Manchuria and overthrew the Ming Dynasty. The Qing emperors, who were not ethnically Chinese, struggled with ruling over the Han Chinese population. Key events during the Qing Dynasty included the Opium Wars, which weakened China's authority, and the Taiping Rebellion, one of the deadliest civil wars in history. The long reigns of Kangxi and Qianlong emperors were periods of stability and prosperity. However, foreign exploitation and the rule of non-Chinese emperors made the Qing Dynasty unpopular with many Han Chinese.