 Survivors of the Mạc royal family fled to the northern mountains in the province of Cao Bằng and continued to rule there until 1677 when Trịnh Tạc conquered this last Mạc territory.The Lê kings, ever since Nguyễn Kim's restoration, only acted as figureheads.After the fall of the Mạc dynasty, all real power in the north belonged to the Trịnh lords.