Vietnam has been colonized twice throughout its existence. The first colonization was by the Chinese; the second was by the French. Chinese colonization lasted for almost 1,000 years, beginning with the annexation of Northern Vietnam in 111 B.C.
Many Chinese to fled to Vietnam when the Han Dynasty collapsed. This prompted the first of many periods of discontent on the side of the Vietnamese until when Ngo Quyen defeated the Chinese.
The French, and many other European Countries, made contact with Vietnam well before the 19th century. However, it was not until it became clear to France that the Vietnamese were not going to directly support French interests that colonization became official in 1874. This lasted until 1954, after the French-Indochina War, when Vietnam finally got a chance to self-govern.