The civil war between the Lê-Trịnh and Mạc dynasties ended in 1592, when the military 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 continued to rule there until 1677 https://judahahoxc.blogocial.com/the-smart-trick-of-việt-nam-that-nobody-is-discussing-66989508