<P> In 1771, the Tây Sơn revolution broke out in Quy Nhơn, which was under the control of the Nguyễn lord . The leaders of this revolution were three brothers named Nguyễn Nhạc, Nguyễn Lữ, and Nguyễn Huệ, not related to the Nguyễn lords . By 1776, the Tây Sơn had occupied all of the Nguyễn Lord's land and killed almost the entire royal family . The surviving prince Nguyễn Phúc Ánh (often called Nguyễn Ánh) fled to Siam, and obtained military support from the Siamese king . Nguyễn Ánh came back with 50,000 Siamese troops to regain power, but was defeated at the Battle of Rạch Gầm--Xoài Mút and almost killed . Nguyễn Ánh fled Vietnam, but he did not give up . </P> <P> The Tây Sơn army commanded by Nguyễn Huệ marched north in 1786 to fight the Trịnh Lord, Trịnh Khải . The Trịnh army failed and Trịnh Khải committed suicide . The Tây Sơn army captured the capital in less than two months . The last Lê emperor, Lê Chiêu Thống, fled to Qing China and petitioned the Qianlong Emperor for help . The Qianlong Emperor supplied Lê Chiêu Thống with a massive army of around 200,000 troops to regain his throne from the usurper . Nguyễn Huệ proclaimed himself Emperor Quang Trung and defeated the Qing troops with 100,000 men in a surprise 7 day campaign during the lunar new year (Tết). There was even a rumor saying that Quang Trung had also planned to conquer China, although it was unclear . During his reign, Quang Trung envisioned many reforms but died by unknown reason on the way march south in 1792, at the age of 40 . During the reign of Emperor Quang Trung, Đại Việt was in fact divided into three political entities . The Tây Sơn leader, Nguyễn Nhạc, ruled the centre of the country from his capital Qui Nhơn . Emperor Quang Trung ruled the north from the capital Phú Xuân Huế . In the South, Nguyễn Ánh, assisted by many talented recruits from the South, captured Gia Định (present - day Saigon) in 1788 and established a strong base for his force . </P> <P> After Quang Trung's death, the Tây Sơn dynasty became unstable as the remaining brothers fought against each other and against the people who were loyal to Nguyễn Huệ's infant son . Nguyễn Ánh sailed north in 1799, capturing Tây Sơn's stronghold Qui Nhơn . In 1801, his force took Phú Xuân, the Tây Sơn capital . Nguyễn Ánh finally won the war in 1802, when he sieged Thăng Long (Hanoi) and executed Nguyễn Huệ's son, Nguyễn Quang Toản, along with many Tây Sơn generals and officials . Nguyễn Ánh ascended the throne and called himself Emperor Gia Long . Gia is for Gia Định, the old name of Saigon; Long is for Thăng Long, the old name of Hanoi . Hence Gia Long implied the unification of the country . The Nguyễn dynasty lasted until Bảo Đại's abdication in 1945 . As China for centuries had referred to Đại Việt as Annam, Gia Long asked the Manchu Qing emperor to rename the country, from Annam to Nam Việt . To prevent any confusion of Gia Long's kingdom with Triệu Đà's ancient kingdom, the Manchu emperor reversed the order of the two words to Việt Nam . The name Vietnam is thus known to be used since Emperor Gia Long's reign . Recently historians have found that this name had existed in older books in which Vietnamese referred to their country as Vietnam . </P> <P> The Period of Division with its many tragedies and dramatic historical developments inspired many poets and gave rise to some Vietnamese masterpieces in verse, including the epic poem The Tale of Kiều (Truyện Kiều) by Nguyễn Du, Song of a Soldier's Wife (Chinh Phụ Ngâm) by Đặng Trần Côn and Đoàn Thị Điểm, and a collection of satirical, erotically charged poems by a female poet, Hồ Xuân Hương . </P>

Who controlled vietnam during the late 1800s to 1954