The Nguyễn dynasty (Vietnamese: Nhà Nguyễn or Triều Nguyễn, chữ Nôm: 茹阮, chữ Hán: 朝阮) was the last Vietnamese dynasty, preceded by the Nguyễn lords and ruling unified Vietnam independently from 1802 until the start of the French protectorate in 1883. Its emperors were members of the House of Nguyễn Phúc. During its existence, the Nguyễn empire expanded into modern-day Southern Vietnam, Cambodia, and Laos through a continuation of the centuries-long Nam tiến and Siamese–Vietnamese wars. With the French conquest of Vietnam, the Nguyễn dynasty was forced to give up sovereignty over parts of Southern Vietnam to France in 1862 and 1874, and after 1883 the Nguyễn dynasty only nominally ruled the French protectorates of Annam (Central Vietnam) as well as Tonkin (Northern Vietnam). Backed by Imperial Japan, in 1945 the last Nguyễn emperor Bảo Đại abolished the protectorate treaty with France and proclaimed the Empire of Vietnam for a short time until 25 August 1945.
The House of Nguyễn Phúc established control over large amounts of territory in Southern Vietnam as the Nguyễn lords (1558–1777, 1780–1802) by the 16th century before defeating the Tây Sơn dynasty and establishing their own imperial rule in the 19th century. The dynastic rule began with Gia Long ascending the throne in 1802, after ending the previous Tây Sơn dynasty. The Nguyễn dynasty was gradually absorbed by France over the course of several decades in the latter half of the 19th century, beginning with the Cochinchina Campaign in 1858 which led to the occupation of the southern area of Vietnam. A series of unequal treaties followed; the occupied territory became the French colony of Cochinchina in the 1862 Treaty of Saigon, and the 1863 Treaty of Huế gave France access to Vietnamese ports and increased control of its foreign affairs. Finally, the 1883 and 1884 Treaties of Huế divided the remaining Vietnamese territory into the protectorates of Annam and Tonkin under nominal Nguyễn Phúc rule. In 1887, Cochinchina, Annam, Tonkin, and the French Protectorate of Cambodia were grouped together to form French Indochina.