In 1802, after defeating the Tây Sơn Dynasty, King Gia Long founded the Nguyễn Dynasty and established a unified government for the whole country. In 1804, he named the country Việt Nam. In 1838, King Minh Mạng renamed it Đại Nam. After the August Revolution and National Independence Day in 1945, the country was named the Democratic Republic of Việt Nam. On April 30, 1975, the South was liberated and the country was unified. Since 1976, its official name has been the Socialist Republic of Việt Nam.