After the Le-Mac war ended in 1592 with the Mạc ousted from the Red River Delta, the two clans of Trịnh and Nguyễn who revived the Le dynasty emerged as the strongest powers, and resumed their own infighting, from 1627 to 1672. The northern Trịnh clan had installed themselves as regency for the Le dynasty by 1545, but in reality, they hold most power of the royal court and de facto rulers of the northern half of Dai Viet, and began using the title Chúa (lord), which is outside of the classical hierarchy of nobility. The Le king was reduced to a figurehead, he ruled in earnest, while the Trịnh lord had total power to select and enthrone or remove any king the lord favors. The southern Nguyễn leader also began to proclaim as Chúa lord in 1558. Initially, they were considered subjects of the Le court, which was controlled by the Trịnh lord. But later, by the early 1600s, they ruled southern Dai Viet like an independent kingdom and became the main rival to the Trịnh domain. Le Thanh Tong's legacy such as his 1463 Code and bureaucratic institutions, was revived in the north and somehow continued to persist and lasted until French Indochina period.