down the rebellions while establishing his clan and supporters to the government. In 1527 he enforced the young Lê king to abdicate and proclaimed himself emperor and began the rule of the Mạc dynasty. Six years later, Nguyễn Kim–a Nguyễn noble and Lê loyalist-rebelled against the Mạc, enthroned Lê Duy Ninh–a descendant of Lê Lợi and began the monarchy-in-exile in Laos. In 1542 they reemerged from the south, known as the southern court, laid claim to the Vietnamese crown, and opposed the Mạc (the northern court). The Việt kingdom now fell into a long period of depressions, decentralization, chaos, and civil wars that lasted for three centuries. The Lê (assisted by Nguyễn Kim) and the Mạc loyalists fought on behalf of reclaiming the legitimate Vietnamese crown. When Nguyễn Kim died in 1545, the power of the Lê dynasty swiftly fell into the dictate of the lord Trịnh Kiểm of the Trịnh family. One of Nguyễn Kim's sons, Nguyễn Hoàng, was appointed as ruler of the southern part of the kingdom, thus began the Nguyễn family rule over Đàng Trong. The Lê-Trịnh loyalists expelled the Mạc from Hanoi in 1592, forcing them to flee into the mountainous hinterland, where their reign lasted until 1677. The Trịnh-controlled northern Đại Việt was known as Đàng Ngoài (Outer Realm), while the Nguyễn-controlled south became Đàng Trong (Inner Realm). They fought a fifty-year civil war (1627–1673), which ended inconclusively and the two lords signed a peace treaty. This stable division would last until 1771 when three Tây Sơn brothers Nguyễn Nhạc, Nguyễn Huệ and Nguyễn Lữ led a peasant revolution that would overrun and topple the Nguyễn, the Trịnh lords, and the Le dynasty. In 1789, the Tây Sơn defeated a Qing intervention that sought to restore the Lê dynasty. Nguyễn Nhạc established a monarchy in 1778 (Thái Đức), followed by his brother Nguyễn Huệ (Emperor Quang Trung, r. 1789–1792) and nephew Nguyễn Quang Toản (Emperor Cảnh Thịnh, r. 1792–1802), while a descendant of the Nguyễn lords, Nguyễn Ánh returned to the Mekong Delta, after several years exiled in Thailand and France. Ten years later Nguyễn loyalists defeated the Tây Sơn and conquered the whole kingdom. Nguyễn Anh became the emperor of the new unified Vietnamese state. Political structure Pre-1200s In the early Đại Việt period (pre-1200), the Viet monarchy existed as a form of what historians describe as a "charter state" or a "mandala