Mạc dynasty
The Mạc dynasty ( / "Mạc triều"; Hán Nôm: 家莫 / 莫朝), as known as House of Mạc ruled the whole of Đại Việt between 1527 and 1540 and the northern part of the country from 1540 until 1592, when they lost control over the capital Đông Kinh for the last time in their wars against the Lê dynasty. Subsequent members of the Mạc dynasty ruled over the province of Cao Bằng (with the direct support of the Ming and Qing dynasties) until 1677. Mạc Đăng Dung. The founder of the Mạc dynasty was a descendant of the famed Trần dynasty  scholar Mạc Đĩnh Chi. Mạc Đăng Dung chose to enter the military and ascended the ranks to become the senior general in the Lê dynasty army. Later he seized power and ruled Vietnam from 1527 till his death in 1541. Mạc Đăng Dung, got his start as a bodyguard for Lê Uy Mục, the unpopular Lê Emperor, around 1506. Over time, despite the deaths of several emperors, Mạc Đăng Dung increased his power and gained many supporters. However, he also gained the enmity of other rivals for power. After a series of political crises that made both Lê Uy Mục  and his successor Lê Tương Dực assassinated, Mạc Đăng Dung continued to gain power and rank in the military. 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. From 1516 to 1520, the warlords of Nguyễn Hoàng Dụ and Trịnh Duy Sản, Nguyễn Kính and Trần Cao were fighting for power. Mạc Đăng Dung initially led the forces loyal to King Lê Chiêu Tông against the warlords, he eventually defeated the warlords and gained enough power to force Lê Chiêu Tông to abdicate  in 1522 and install the puppet Emperor Lê Cung Hoàng to the throne. 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. In 1527 Mạc Đăng Dung removed Lê Cung Hoàng and proclaimed himself as Emperor of the new Mạc dynasty under the title Minh Đức. The usurpation was not well received by the Confucian officials in the government. Some were killed, others fled to join a new revolt against the Mạc Emperors. A new revolt was  led by Nguyễn Kim (father of Nguyễn Hoàng, the first of the Nguyễn lords who later ruled southern Vietnam) and his subordinate and son-in-law Trịnh Kiểm (the first of the Trịnh lords). They installed Lê Trang Tông as Emperor of the Revival Lê dynasty and built their base in Thanh Hóa and Nghệ An provinces to resist against Mạc Đăng Dung. Both sides tried to pull in allies, mainly the Ming dynasty but also from King Phothisarat I of Lan Xang (modern-day Laos). Mạc Đăng Dung, through submissive diplomacy and massive bribes, convinced the Ming not to  attack in 1528. He then abdicated his position as Emperor in favor of his son, Mạc Đăng Doanh a year later. 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). Restoration of the Lê. The revolt of the Revival Lê in the south gathered strength and over the next three years all the provinces south of the Red River were captured by the Lê armies. In 1533 the figurehead Lê Emperor, Lê Trang Tông, was officially crowned at the recaptured Tây Đô  castle. This marked the beginning of the Southern and Northern dynasties era. The Lê and Mạc would continue the lengthy civil war over the next 40 years. In 1540, Mạc Đăng Doanh died and Mạc Đăng Dung reclaimed the throne. The Ming dynasty threatened Mạc Đăng Dung with an invasion of 110,000 men ready to invade Vietnam from Guangxi. Mac caved in to Chinese pressure and accepted their bitter 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. The Ming official position was that the Mạc should rule over the northern half of Vietnam, while the Lê should rule over the southern half (in other words, below the Red River). The Nguyễn and the Trịnh refused to accept this division of the country and the war continued. In 1541, Mạc Đăng Dung died and was succeeded by his grandson Mạc Phúc Hải. 1541–92: Lê–Mạc wars. Mạc Phúc Hải ruled only for six years, during which he was defeated by the Trịnh army and lost more territories. He was succeeded by  Mạc Phúc Nguyên (1545–61) who had to fight a war with his brother Trung. Mạc Mậu Hợp ruled from 1561 to 1592. He was the last significant Mạc ruler. In 1572 the capital was captured by the Trịnh army but then he recaptured it a year later. 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. Mạc Mậu Hợp was captured during the retreat and was cut to pieces over three days. The Mạc had lost control over most of Vietnam, only retaining areas around Cao  Bằng Province under the formal protection of the Ming army. 1592–1677: withdrawn to Cao Bằng and decline. In 1592, the new Mạc leader was Mạc Kinh Chi. He managed to assemble a large army which defeated the army of Trịnh Tùng but a year later, he and his army were wiped out by a new Trịnh army under Trịnh Tùng. Mạc Kinh Cung ruled for more than twenty years (1593–1616). Based out of Van Ninh (Quảng Ninh Province) the Mạc army staged many attacks against the Trịnh. The Trịnh requested and received aid from the Nguyễn and the joint army  (with Nguyễn Hoàng) defeated the Mạc. In 1598, yet another official Ming commission declared the Mạc to be rulers over Cao Bằng province and so the Mạc rulers stayed in this protected area, occasionally launching raids into Trịnh controlled Vietnam. In 1627, the Lê army attacked Cao Bằng, the Mạc ruler Mạc Kính Khoan had to surrender and accept the Lê title of "Thông quốc công", reducing the Mạc realm to a Duchy under the Lê dynasty. 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. The Kangxi Emperor attempted to negotiate peace between the two states. After the Lê attacked and gained control of Cao Bằng Province without permission from the Qing, the Kangxi Emperor demanded in 1667 that Lê Chiêu Thống return Cao Bằng Province to the Mạc. In 1673, the Qing had lost interest in mediating the conflict on behalf of the Mạc. 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. The Kangxi Emperor and his advisors agreed to arrest Mạc  Kính Vũ as he fled into Guangxi, leading to the demise of the Mạc dynasty. Foreign relations. The Lê dynasty held a tributary relationship with the Ming dynasty in exchange for the recognition and military protection. As part of their tributary relationship, the Ming to provided external military support to the Lê state against the Mạc beginning in 1537. After the 1540 surrender of the Mạc to the Ming, the Ming court ceremonially revoked the Lê dynasty's status as an independent kingdom and reclassified it as a "dutongshisi": a category only slightly higher than a chieftaincy. After 1540, the  Ming received tribute from both the Lê dynasty and the Mạc, a state of affairs that continued through the end of the Southern Ming at which point the two sides became tributary states of the Qing dynasty. Legacy. While contemporary historians of feudal Le and Nguyen dynasties regarded Mac rulers as downright usurpers, historians after 1945 debate over this controversial dynasty with more favorable and objective viewpoints. Modern researchers recognize that during the reign of Mạc Emperors, women enjoyed much more freedom and privileges than in the previous dynasties. The Mạc court also allowed domestic and foreign trade to flourish , resulting in the rise of Đông Đô and the surrounding areas such as Chu Đậu in Hải Dương province as an important link in the East-West maritime commerce route. Many notable figures of the Mạc court, such as Prince regent Mạc Kính Điển, general Nguyễn Quyện, general Mạc Ngọc Liễn were praised by both friends and foes for their virtues, talents and exceptional loyalty, which is indeed rarely seen far and wide.