In 1940, France was swiftly defeated by Nazi Germany, and colonial administration of French Indochina (modern-day Vietnam, Laos and Cambodia) passed to the pro-German Vichy French government. Later that year, the Vichy government ceded control of Hanoi and Saigon to Japan; and in 1941, Japan extended its control over the whole of French Indochina. The United States, concerned by this expansion, put embargoes on exports of steel and oil to Japan. The desire to escape these embargoes and become resource self-sufficient ultimately led to Japan's decision on December 8, 1941 to attack the British Empire in Hong Kong, Malaya and Singapore and simultaneously the USA at Pearl Harbor, Hawaii. This led to the USA declaring war against Japan. The US then joined the British Empire, already at war with Germany since 1939, and its existing allies in the fight against the Axis nations.
Indochinese Communists had set up hidden headquarters in 1941, but most of the Vietnamese resistance to Japan, France or both, including both communist and non-communist groups, remained based over the border, in China. As part of the Allied fighting against the Japanese, the Chinese formed a nationalist resistance movement, the Dong Minh Hoi (DMH); this included Communists, but was not controlled by them. When this did not provide the desired intelligence data, they released Ho Chi Minh from jail, and he returned to lead an underground centered on the Communist Viet Minh. This mission was assisted by Western intelligence agencies, including the American Office of Strategic Services (OSS).Free French intelligence also tried to affect developments in the Vichy-Japanese collaboration.
In March 1945, the Japanese imprisoned the Vichy French and took direct control of Vietnam until they were defeated by the Allies in August. At that point, there was an attempt to form a Provisional Government, but the French took back control of the country in 1946.