The civil war concerning the Lê-Trịnh and Mạc dynasties resulted in 1592, when the army of Trịnh Tùng conquered Hanoi and executed king Mạc Mậu Hợp. Survivors on the Mạc royal family fled into the northern mountains during the province of Cao Bằng and continued to rule there right up until 1677 when Trịnh Tạc conquered this fi