The civil war in between the Lê-Tr?nh and M?c dynasties led to 1592, when the military of Tr?nh Tùng conquered Hanoi and executed king M?c M?u H?p. Survivors on the M?c royal household fled for the northern mountains within the province of Cao B?ng and ongoing to rule there right until 1677 when Tr?nh T?c conquered this past M?c territory. The L�