Mạc dynasty
The dynasty officially began in 1428 with the enthronement of Lê Lợi after he drove the Ming army from Vietnam. The dynasty reached its peak during the reign of Lê Thánh Tông and declined after his death in 1497. In 1527, the Mạc dynasty usurped the throne; when the Lê dynasty was restored in 1533, the Mạc fled to the far north and continued to claim the throne during the period known as Southern and Northern Dynasties. The restored Lê emperors held no real power, and by the time the Mạc dynasty was finally eradicated in 1677, actual power lay in the hands of the Trịnh lords in the North and Nguyễn lords in the South, both ruling in the name of the Lê emperor while fighting each other. The Lê dynasty officially ended in 1789, when the peasant uprising of the Tây Sơn brothers defeated both the Trịnh and the Nguyễn, ironically in order to restore power to the Lê dynasty.