As it had under Chinese rule, Vietnamese nationalism simmered quietly throughout the country, waiting for an opportunity. Young Nguyen Tat Thanh, better known by his alias Ho Chi Minh, thought that the end of WWI was a good opening, so he tried to present a plan for an independent Vietnam to US president Woodrow Wilson at the 1919 Versailles Peace Conference. Evidently, self-determination was for Europeans alone.
When France fell to Nazi Germany in 1940, the Vichy government allowed the Japanese to put troops in Vietnam. The United States knew enough not to count on any French resistance, instead opting to pump arms and funding into the communist-dominated Viet Minh forces. Their leader, Ho Chi Minh, graciously accepted and began harassing the Japanese mercilessly.
After the bombing of Hiroshima and Nagasaki, Ho called for a general uprising known as the August Revolution, and on September 2, 1945, Ho and his National Liberation Committee (with US officials at his side) declared the Democratic Republic of Vietnam independent at a rally in Ba Dinh Square.
The French were not pleased, and fought the Viet Minh tooth and nail for eight years, despite a massive military aid package from the USA and formal recognition by both China and the USSR. On May 7, 1954, the French threw in the towel and surrendered North Vietnam to the Viet Minh. Fiercely anti-communist leader Ngo Dinh Diem was elected (more or less; a lot of dead people voted in that election) president of South Vietnam. Soon afterward, the USA closed its consulate in Hanoi.
In 1959, Southern cadres asked that the North Vietnamese join them in 'armed struggle' against the Diem regime. Hanoi responded by agreeing to help the National Liberation Front (NLF), also known as the Viet Cong, who were mainly communist South Vietnamese resisters with little training. Without French troops, however, the South Vietnamese army was incredibly weak, and the Western world looked on nervously as Diem began losing control of the situation.
The USA sent 2000 'military advisers' to South Vietnam in 1961, the number swelling to 23,000 by 1964. By then, Hanoi was no longer helping the NLF out with guns and training; they were sending trained North Vietnamese troops across the border. Despite small victories, Hanoi's war didn't seem winnable until the 1968 Tet Offensive, when Hanoi gained the upper hand.
The USA continued to throw warm bodies - to the tune of 3.14 million men and women - at the increasingly bloody conflict until the 1973 cease-fire. The USA evacuated almost all troops out of Vietnam in return for Hanoi's commitment to keep communism above the 17th Parallel. They also cut off most financial and other aid to South Vietnam. By 1975, the southern half of the country was running on fumes.
North Vietnam launched a massive attack on the South on January 1975; Saigon surrendered in April. No one, least of all the leadership in Hanoi, was prepared for reunification. At least two million Vietnamese had died in the conflict and scars ran deep; the environment and economy were a shambles. The violence wasn't over, either: In 1979, answering for Vietnam's 1978 invasion of Cambodia, China attacked Hanoi. The Chinese were repelled within 17 brutal days.
The 1980s witnessed a devastating famine that left Hanoi with rice shortages and strict rations, a continuing guerrilla war with the Khmer Rouge in Cambodia and the opening of European communism. Surprisingly, Vietnam finished the decade in much better shape than it started.
In February 1990, the government called for more 'openness and criticism', but was unprepared for the seething discontent behind the floodgates. Hanoi backtracked, but began allowing more economic openness while keeping government structure (and media access) in a lockbox. In 1992 Vietnam signed a peace treaty with Cambodia, and in 1994, the USA lifted economic sanctions on the country. The two former enemies now maintain diplomatic relations.