The history of Vietnam covers a period of more than 2,700 years. By far Vietnam's most important historical international relationship has been with China. Vietnam's prehistory includes a legend about a kingdom known as Van Lang (2787–2858 BC) that included what is now China's Guangxi Region and Guangdon Province, as well as the northern part of Vietnam. Later, successive dynasties based in China ruled Vietnam directly for most of the period from 207 BC until 938 when Vietnam regained its independence. Vietnam remained a tributary state to its larger neighbor China for much of its history but repelled invasions by the Chinese as well as three invasions by the Mongols between 1255 and 1285. Emperor Tran Nhan Tong later diplomatically submitted Vietnam to a tributary of the Yuan to avoid further conflicts. The independent period temporarily ended in the middle to late 19th century, when the country was colonized by France.

During World War II, Imperial Japan expelled the French to occupy Vietnam, though they retained French administrators during their occupation. After the war, France attempted to re-establish its colonial rule, but ultimately failed in the First Indochina War. The Geneva Accords partitioned the country in two with a promise of democratic election to reunite the country. However, rather than peaceful reunification, partition led to the Vietnam War which ended with the Fall of Saigon in April 1975.