War came unexpectedly to the Philippines. Japan openned a surprise attack on the Philippines on December 8, 1941, when Japan attacked without warning, just ten hours after the attack on Pearl Harbor. Japanese troops attacked the islands in many places and launched a pincer drive on Manila. Aerial bombardment was followed by landings of ground troops in Luzon. The defending Philippine and United States troops were under the command of General Douglas MacArthur. Under the pressure of superior numbers, the defending forces (about 80,000 troops, four fifths of them Filipinos) withdrew to the Bataan Peninsula and to the island of Corregidor at the entrance to Manila Bay where they entrenched and tried to hold until the arrival of reinforcements, meanwhile guarding the entrance to Manila Bay and denying that important harbor to the Japanese. But no reinforcements were forthcoming. Manila, declared an open city to stop its destruction, was occupied by the Japanese on January 2, 1942. The Philippine defense continued until the final surrender of United States-Philippine forces on the Bataan Peninsula in April 1942 and on Corregidor in May. Most of the 80,000 prisoners of war captured by the Japanese at Bataan were forced to undertake the notorious Bataan Death March to a prison camp 105 kilometers to the north. It is estimated that as many as 10,000 men died before reaching their destination.

Quezon and Osmeña had accompanied the troops to Corregidor and later left for the United States, where they set up a government in exile. MacArthur was ordered out by President Roosevelt and left for Australia on Mar. 11, where he started to plan for a return to the Philippines; Lt. Gen. Jonathan Wainwright assumed command.

The besieged U.S.-Filipino army on Bataan finally fell down on Apr. 9, 1942. Wainwright fought on from Corregidor with a barracks of about 11,000 men; he was overwhelmed on May 6, 1942. After his surrender, the Japanese forced the surrender of all remaining defending units in the islands by threatening to use the captured Bataan and Corregidor troops as hostages. Many individual soldiers refused to surrender, however, and guerrilla resistance, organized and coordinated by U.S. and Philippine army officers, continued throughout the Japanese occupation.

The Japanese military authorities immediately began organizing a new government structure in the Philippines. They initially organized a Council of State through which they directed civil affairs until October 1943, when they declared the Philippines an independent republic. The Japanese-sponsored republic headed by President José P. Laurel proved to be unpopular.

Japanese occupation of the Philippines was opposed by large-scale underground and guerrilla activity. The Philippine Army continued to fight the Japanese in a guerrilla war and was considered a back up unit of the United States Army. Their effectiveness was such that by the end of the war, Japan controlled only twelve of the forty-eight provinces. The major element of resistance in the Central Luzon area was furnished by the Hukbalahap (Hukbo ng Bayan Laban sa mga Hapon - "People's Army Against the Japanese"), which armed some 30,000 people and extended their control over much of Luzon.

Japan’s efforts to win Filipino loyalty found expression in the establishment (Oct. 14, 1943) of a “Philippine Republic,” with José P. Laurel, former Supreme Court justice, as president. But the people suffered greatly from Japanese brutality, and the puppet government added little support. Meanwhile, President Quezon, who had escaped with other high officials before the country fell, set up a government-in-exile in Washington. When he died (Aug., 1944), Vice President Sergio Osmeña became president. Osmeña returned to the Philippines with the first liberation forces, which surprised the Japanese by landing (Oct. 20, 1944) at Leyte, in the heart of the islands, after months of U.S. air strikes against Mindanao. The Philippine government was established at Tacloban, Leyte, on Oct. 23.

MacArthur's Allied forces landed on Leyte on October 20, 1944. Landings in other parts of the country followed, and the Associates pushed toward Manila. The landing was followed (Oct. 23–26) by the greatest naval engagement in history, called variously the battle of Leyte Gulf and the second battle of the Philippine Sea. A great U.S. victory, it effectively destroyed the Japanese navy and opened the way for the recovery of all the islands. Luzon was invaded (Jan., 1945), and Manila was taken in February. On July 5, 1945, MacArthur announced “All the Philippines are now liberated.” The Japanese had suffered over 425,000 dead in the Philippines. Fighting continued until Japan's formal surrender on September 2, 1945. The Philippines suffered great loss of life and monstrous physical destruction by the time the war was over. An estimated 1 million Filipinos had been killed, and Manila was extensively damaged.

The Philippine congress met on June 9, 1945, for the first time since its election in 1941. It faced huge problems. The land was destroyed by war, the economy destroyed, the country torn by political warfare and guerrilla violence. Osmeña’s leadership was challenged (Jan., 1946) when one wing (now the Liberal party) of the Nationalist party nominated for president Manuel Roxas, who defeated Osmeña in April.