The 1200s saw a number of Mongol attacks from China, however these were again unsuccessful as the people and armies fled into the mountains, hence trapping the invading armies. They also fought the Champas to the south in the 1200s and 1300s, slowly taking lands, while also going bankrupt.
In 1400 the Tran Dynasty fell as Ho Dynasty took power, but this opened the door to the Chinese and in 1407 the Chinese Ming Dynasty took over the entire region. After numerous wars, this ended in 1428 as the Le Dynasty came to power. During the latter part of the century the people took over the Champas and the Laos.
In the early 1500s the king was again overthrown as the Mac Dynasty came to power, but by century's end the Le and Trinh had taken over once again, although at this point all power fell into the hands of the upper class, not the king. These battles continued into the 1600s, which time with the Nguyen family, which essentially divided the country into north (Trinh) and south (Nguyen).
The wars led to greater European intervention as the Portuguese supported the Nguyen and the Dutch the Trinh. From this point on the Europeans gained a strong foothold into the country, which before this was limited to trade along the coast and a limited number of missionaries inland.
The 1700s and early 1800s were again clouded by war as there were uprisings, most significantly in the south as the king had to flee to Siam (Thailand), but returned to re-take his kingdom. In the north the kings were also overthrown and the Chinese again got involved to assist the king to regain control. During this time the country fell into chaos and opened the door to the French.
In 1802 Nguyen Anh retook control of the south with French assistance. Although he was friendly to the French, his successors refused French interference, rejected Catholicism, and bulked at western technology. This lack of technology and modern military weapons essentially allowed the French to take over the region as a colony by 1886.
Under French rule in the early 1900s education was expanded and western thinking was introduced; while this improved the country in numerous ways, it also threatened French control as many young educated people wanted independence from France. These movements, and the French resistance to them, led to numerous political parties and extreme politics in nearly every direction arising among the people in underground societies.
In 1941, with Japan presence in Vietnam, Nguyen Ai Quoc (later known as Ho Chi Minh) organized numerous groups to fight for Vietnamese independence. He was a communist though and his groups soon dominated this force fighting for independence. During the war, this group worked with both the Chinese and Americans to fight the Japanese.
Once the Japanese fell in 1945 the communists quickly took power in the north. This was later revoked by the French who had returned, but held little power at this point. It was also resisted by the British and others who disagreed with the party led by Ho Chi Minh. Eventually the French fell from power and moved out of the region in 1954 after a military defeat. This led the United Nations to declare that the country was two: a communist north and Ngo Dinh Diem's government in the south. This led to civil war, but with much foreign intervention.
The Viet Cong in the north unified the people there under communist rule and allied with the Soviets for support while the south allied with the United States, making Vietnam another battleground in the Cold War. After years of fighting, which began in 1954, a peace settlement was written in 1973 allowing the south independence and free elections. This led to the withdrawal of American troops and in 1975 led to the north's attack on the south, taking their capital of Saigon, which they renamed Ho Chi Minh City.
After the communist takeover of the south hundreds of thousands of people fled as the government tried to shift from a war-time mentality to nation building. Unfortunately, this nation building was based on destroying the free market economy of the south and this led to a complete economic collapse in the 1980s. It also led to continuing violence as they invaded Cambodia (removing the Khmer Rouge rulers) and this welcomed fighting with China on a smaller scale. Finally, due to the war and the government's political stances, they made few international allies.
The weakening economy led to a reversal of many collectivization projects and other communist ideals in favor of a more open economy. It also led to a heavy reliance on the Soviet Union to maintain their economy.
Since the fall of the Soviet Union in 1991 Vietnam has opened its doors to a great extent. Relations with numerous countries have been established, including the United States and many European countries that cut ties in the 1970s and 1980s. The economy is slowly improving and tourism is quickly growing.