In early 1945, due to a combination of Japanese exploitation and poor weather, a famine broke out in Tonkin killing between 1 and 2 million people (out of a population of 10 million in the affected area). In March 1945, Japanese occupying forces ousted the French administration in Indochina as they had been holding secret talks with the Free French. Emperor Bảo Đại of the Nguyễn Dynasty nominally declared Vietnam independent, but the Japanese remained in occupation. Exploiting the administrative gap [8] that the internment of the French had created, the Viet Minh in March 1945 urged the population to ransack rice warehouses and refuse to pay their taxes. Between 75 and 100 warehouses were consequently raided. This rebellion against the effects of the famine and the authorities that were partially responsible for it bolstered the Viet Minh's popularity and they recruited many members during this period.
When the Japanese surrendered to the Allies in August 1945 a power vacuum was created in Vietnam. Capatilizing on this, the Việt Minh launched the "August Revolution" across the country to seize government offices. Emperor Bảo Ðại abdicated on August 25, 1945, ending the Nguyễn Dynasty. On September 2, 1945 Hồ Chí Minh declared Vietnam independent under the new name of the Democratic Republic of Vietnam (DRV) and held the position of Chairman (Chủ Tịch).
British forces landed in southern Vietnam in October, disarming the Japanese and restoring order. The British commander in South East Asia, Lord Louis Mountbatten, sent over 20,000 troops of the 20th Indian division under General Douglas Gracey to occupy Saigon. The first soldiers arrived on 6 September and increased to full strength over the following weeks. In addition they re-armed Japanese prisoners of war known as Gremlin force. The British began to withdraw in December 1945, but this was not completed until June of the following year. The last British soldiers were killed in Vietnam in June 1946. Altogether 40 British and Indian troops were killed and over a hundred were wounded. Vietnamese casualties were 600. They were followed by French troops trying to re-establish their rule. In the north, Chiang Kai-shek's Kuomintang army entered Vietnam from China, also to disarm the Japanese, followed by the forces of the non-Communist Vietnamese parties, such as Việt Nam Quốc Dân Đảng and Việt Nam Cách Mạng Đồng Minh Hội. In 1946, Vietnam had its first National Assembly election (won by the Viet Minh in central and northern Vietnam), which drafted the first constitution, but the situation was still precarious: the French tried to regain power by force; some Cochin-Chinese politicians formed a seceding government of Cochin-China (Nam Kỳ Quốc) while the non-Communist and Communist forces were engaging each other in sporadic battle. Stalinists purged Trotskyists. Religious sects and resistance groups formed their own militias. The Communists eventually suppressed all non-Communist parties but failed to secure a peace deal with France.
In 1947 full scale war broke out between the Viet Minh and France. Realizing that colonialism was coming to an end worldwide, France fashioned a semi-independent State of Vietnam, within the French Union, with Bảo Đại as Head of State. Meanwhile, as the Communists under Mao Zedong took over China, the Viet Minh began to receive military aid from China. Beside supplying materials, Chinese cadres also pressured the Vietnamese Communist Party, then under First Secretary Trường Chinh, to emulate their brand of revolution, unleashing a purge of "bourgeois and feudal" elements from the Viet Minh ranks, carrying out a ruthless and bloody land reform campaign (Cải Cách Ruộng Đất), and denouncing "bourgeois and feudal" tendencies in arts and literature. Many true patriots and devoted Communist revolutionaries in the Viet Minh suffered mistreatment or were even executed during these movements. Many others became disenchanted and left the Viet Minh. The United States became strongly opposed to Hồ Chí Minh. In the 1950s the government of Bảo Ðại gained recognition by the United States and the United Kingdom.
The Việt Minh force grew significantly with China's assistance and in 1954, under the command of General Võ Nguyên Giáp, launched a major siege against French bases in Điện Biên Phủ. The Việt Minh force surprised Western military experts with their use of primitive means to move artillery pieces and supplies up the mountains surrounding Điện Biên Phủ, giving them a decisive advantage. On May 7, 1954, French troops at Điện Biên Phủ, under Christian de Castries, surrendered to the Viet Minh and in July 1954, the Geneva Accord was signed between France and the Viet-Minh, paving the way for the French to leave Vietnam.