A distinct civilisation begins to emerge in the north of present-day Vietnam from about 2000 BCE. By the 6th Century BCE the Vietnamese have developed a sophisticated culture and an elaborate irrigation system for the cultivation of rice.
Self-rule comes to an end in the 208 BCE when the neighbouring Chinese invade, beginning a 1,000-year occupation. Chinese domination is cemented in 111 BCE when the powerful Han Empire takes control, though Vietnamese resistance persists. Rebellion breaks out in 39 CE but is put down within two years. The rebel leaders are the sisters Trung Trac and Trung Nhi. Celebrated as national heroes, they drown themselves rather than face capture by the Chinese.
Rebellion surfaces again in the 2nd Century and continues sporadically for the next 800 years, with the periods of greatest unrest corresponding with the times of greatest Chinese interference. An independent Vietnamese kingdom is formed in 543 but lasts for only 50 years. Meanwhile, Vietnamese rebels based in the Red River Delta develop the hit-and-run tactics of guerrilla warfare that is employed 1,400 years later during the Vietnam War.
In 939 a Vietnamese general establishes himself as king of an independent Vietnam. National unity is strengthened during the succeeding dynasty of Dinh Bo Linh and consolidated in 1009 when Ly Cong Uan takes the throne. The Ly Dynasty lasts until 1225 and begins the expansion of Vietnam south along the coastal plain. The expansion continues during the subsequent Tran Dynasty, though by the end of the 14th Century Vietnam is in danger of fracturing from internal dissent. In 1407 the Chinese reassert control.
This time Chinese rule is shortlived. Rebel leader Le Loi builds a resistance force and defeats the Chinese in 1428. He takes the throne and establishes a dynasty that lasts until 1788, although once again internal dissent convulses the country, resulting in a partition in 1545. In the south the Nguyen Vietnamese continue the conquest of coastal territories and the Mekong Delta, encroaching into Kampuchea-Krom (today's southern Vietnam), which is inhabited by the culturally distinct Khmers (today's Cambodians). In the north the Trinh Vietnamese consolidate their rule.
The country is reunited in 1786 during the Tay Son Rebellion, a period of war and instability that ends in 1802 with the enthronement of Gia Long, an emperor indebted to both the French and the Chinese for his rise. Gia Long changes the name of the country from Dai Viet to Nam Viet but is required by the Chinese to invert this to Viet Nam.
The French now become increasingly involved in Vietnam, led by missionaries and traders then followed by armed forces as the French seek to impose colonial control.
By 1862 the French have forcibly seized Kampuchea-Krom territory in the south. The Treaty of Saigon grants the French trade concessions and gives them control of three provinces. The entire country is made a French protectorate in 1883.
Under French colonial rule Vietnam is partitioned into three sectors. Vietnamese are prohibited from travelling outside their districts without identity papers. Freedom of expression and organisation are restricted. Individuals can be imprisoned at the whim of any French magistrate.
As land is progressively alienated by large landholders, the number of landless peasants grows. Neglect of the education system causes the literacy rate to fall.
Vietnamese anticolonial movements being to emerge early in the 20th Century but are actively suppressed by the French.