Vietnam's history is one of war, colonisation and rebellion.
Occupied by China no fewer than four times, the Vietnamese managed to fight off the invaders just as often. At various points during these thousand years of imperial dynasties, Vietnam was ravaged and divided by civil wars and repeatedly attacked by the Songs, Mongols, Yuans, Chams, Mings, Dutch, Qings, French and the Americans. The victories mostly belonged to the Vietnamese but, even during the periods in history when Vietnam was independent, it was mostly a tributary state to China until the French colonisation. Vietnam's last emperors were the Nguyễn Dynasty, who ruled from their capital at Hue from 1802 to 1945, although France exploited the succession crisis after the fall of Tự Đức to de facto colonise Vietnam after 1884. Both the Chinese occupation and French colonisation have left a lasting impact on Vietnamese culture, with Confucianism forming the basis of Vietnamese social etiquette, and the French leaving a lasting imprint on Vietnamese cuisine.