[4][5] Mạc Đăng Dung chose to enter the military and ascended the ranks to become the senior general in the Lê dynasty army.
With the enthronement of the young emperor Lê Chiêu Tông in 1516, a power struggle in the court ensued to the level of a civil war.
Lê Chiêu Tông fled the court with the support of the warlord Trịnh Tuy to Thanh Hóa where they fought against Mạc Đăng Dung until they were defeated and captured in 1526.
Both sides tried to pull in allies, mainly the Ming dynasty but also from King Phothisarat I of Lan Xang (modern-day Laos).
However, this was done purely to solidify his son's position, Mạc Đăng Dung continued to rule with the title of Senior Emperor (Viet: Thái thượng hoàng).
The Ming dynasty threatened Mạc Đăng Dung with an invasion of 110,000 men ready to invade Vietnam from Guangxi.
Mac acceded to Chinese pressure and complied with bitter Ming demands, including crawling barefoot in front of the Chinese officials, giving up land to China, downgrading his status from the Emperor to Governor (Đô thống sứ 都統使) and giving up official documents like tax registers to the Ming.
Then, in 1592, Trịnh Tùng unleashed a massive invasion of the north and conquered Hanoi along with the rest of the northern provinces.
The Mạc had lost control over most of Northern Vietnam, only retaining areas in and around Cao Bằng Province under the formal protection of the Ming army.
After the fall of the Southern Ming, the Qing dynasty became the mediator in the Lê-Mạc conflict while receiving tribute from both sides.
[9] In 1677, the Revolt of the Three Feudatories in southern China prompted the Qing to enlist the aid of the Lê, who accused the Mạc of joining the rebels.
[1][2][3] As part of their tributary relationship, the Ming provided external military support to the Lê state against the Mạc beginning in 1537.