The Lê–Mạc War (; Hán tự: 戰爭黎莫) was a 59 year-long civil war waged between two Vietnamese dynasties, the Mạc and Revival Lê, during the Southern and Northern Dynasties period of Vietnamese history. The Vietnamese throne was usurped by Mạc Đăng Dung in 1527. Lê Ninh, a prince of the Later Lê dynasty, escaped to Lan Xang. In 1533, Lê Ninh proclaimed himself emperor with the support of Nguyễn Kim and Trịnh Kiểm. The civil war between the two dynasties thus ensued. In 1592, Đông Kinh, the capital of the Mạc dynasty, was reconquered by the Later Lê forces, marking the end of the Southern and Northern Dynasties period. Mạc rulers fled to Cao Bằng Province, with the direct support of the Chinese Ming and Qing dynasties until they were completedly defeated by Trịnh clan in 1677. Background Since 1428, Vietnam was united under the rule of the house of Lê (Later Lê dynasty) after the founder Lê Lợi, also the leader of Lam Sơn uprising, who drove out the Ming Chinese invaders. Soon after, the monarch adopted Neo-Confucianism and state-centralization as a national ideology. The fifth monarch, Emperor Lê Thánh Tông (Lê Hạo) had created the solid National Code based on Neo-Confucian beliefs, helping businesses and trade flourish, and successfully expanded Vietnamese's territories into the Mekong delta and Xiangkhoang Plateau (formerly known as Trấn Ninh plateau). After Thánh Tông's death in 1497, Vietnam fell into swift decline. In 1515, Trần Cảo launched a rebellion against the court. In 1517, a massive typhoon struck Thái Bình and Hải Dương provinces, killing 21,000 peasants. Agriculture and business began collapsing. Peasants and workers demonstrated throughout those provinces. 6 succeed monarchs after Lê Thánh Tông had lost control on the government and the army, caused the rise of military rulers and corruption. In 1522, a military general name Mạc Đăng Dung during his power struggle against the dominant Trịnh clan and Nguyễn clan, had gained the regent of the government by installing Prince Xuan as new Emperor. In 18 June 1527, Mạc Đăng Dung executed Lê Cung Hoàng and established the new Mạc dynasty. The deposed Lê royal family went exile in Lan Xang. In 1533, a Lê loyalist general Nguyễn Kim brought prince Lê Duy Ninh from Trấn Ninh as the emperor Nguyên Hòa, seeking to overthrow Mạc Đăng Dung, and reestablished the Lê monarch in Xiangkhoang Plateau. With the help of