The civil war amongst the Lê-Trịnh and Mạc dynasties ended in 1592, when the army of Trịnh Tùng conquered Hanoi and executed king Mạc Mậu Hợp. Survivors of the Mạc royal family fled to the northern mountains during the province of Cao Bằng and ongoing to rule there until 1677 https://vong085rxc8.wikibriefing.com/user