The Korean War (25 June 1950-27 July 1953) was fought between the allied forces of South Korea and the US-led United Nations coalition and the communist forces of North Korea, China, and the Soviet Union. In the closing days of World War II in August 1945, Soviet Red Army forces occupied the northern half of Japanese Korea, and American forces moved into the south after Japan's surrender. The Americans and Soviets agreed to administer the country under the US-Soviet Joint Commission, but Koreans opposed to the division of their country started an anti-trusteeship movement; the USA used the movements as a tool against socialism. In 1948, the USA decided to go ahead with elections and set up the new state of South Korea, which was ruled by Syngman Rhee's authoritarian conservative Liberal Party of South Korea. The Soviets decided to install the World War II resistance figure Kim Il-sung as the leader of the authoritarian communist state of North Korea, dividing the peninsula.
The South Korean and North Korean governments did not recognize each other, and each country's government claimed to be the legitimate one. On 25 June 1950, with a tacit agreement with China that it would supply military aid if needed, North Korean forces invaded South Korea. The North Koreans were equipped with World War II-era weapons and uniforms, and they used Soviet tanks and guns. On 27 June, in a United Nations resolution boycotted by China (due to the UN's recognition of Taiwanese independence), the UN Security Council authorized the formation and dispatch of UN forces to Korea to repel the North Korean invasion. 21 countries contributed to the UN force, with 88% of the UN troops coming from the USA. Just two months into the war, the South Koreans and Americans were boxed into the Pusan Perimeter, with the North Koreans overrunning the South Korean capital of Seoul and overwhelming the small South Korean and UN forces already on the peninsula. In September 1950, however, an amphibious UN counter-offensive was launched at Inchon, with Douglas MacArthur leading the last major amphibious invasion in military history. The North Koreans were flanked, and many North Korean troops were cut off from the rest of their army. Combined breakouts at Inchon and Pusan forced the North Koreans back, and those who escaped capture and envelopment reeled back north. In late September, the North Korean garrison of Seoul fought to the death, and the South Koreans recaptured their capital. American air raids destroyed most of the Korean People's Army's tanks and much of its artillery, and only 25,000-30,000 North Korean troops were able to rejoin the northern KPA lines. Soviet dictator Joseph Stalin confronted his Politburo and condemned the incompetence of the KPA command and the failures of the Soviet advisers.
On 30 September 1950, US Secretary of Defense George Marshall authorized General MacArthur to proceed north of the 38th parallel border, and South Korean police carried out massacres of suspected communist sympathizers in the Goyang Geumjeong Cave massacre in October 1950, carrying out similar massacres into 1951 (including the Namyangju massacre). Chinese leader Zhou Enlai warned the US that China was prepared to invade Korea if UN forces advanced beyond the 38th parallel, and KPA forces withdrew to the mountains in a similar fashion to the communist withdrawals from the Encirclement Campaigns during the Chinese Civil War. On 19 October 1950, South Korean, US, New Zealander, British, Australian, and Turkish troops entered the North Korean capital of Pyongyang, and the US 187th Infantry Regiment cut the road going north to China, preventing North Korean leaders from fleeing Pyongyang, rescuing American POWs, and penning the North Koreans in the north. By the month's end, 135,000 North Korean soldiers had been captured. General MacArthur proposed an invasion of China to destroy the North Korean supply depots, but President Harry S. Truman instead ordered caution at the Sino-Korean border.
However, the Chinese had paid close attention to the invasion, and Kim Il-sung sent frantic appeals for Chinese intervention, while Stalin asked Mao Zedong to send six divisions into Korea. The Chinese general Peng Dehuai, the orders of Mao, convinced the high command that they needed to intervene in Korea, stirring up fears that the USA might invade China. On 19 October 1950, the 250,000-strong People's Volunteer Army entered North Korea, and the Chinese moved undetected by night. On 25 October, the Chinese launched the "First Phase Offensive" against the UN forces, and the Soviet Air Force provided air cover for the Chinese. The UN forces engaged in heavy fighting against Chinese forces along the Yalu River, and the US 2nd Infantry Division was decimated at the Ch'ongch'on River, while the UN forces suffered 15,000 losses at the Chosin Reservoir. By 4 January 1951, the UN forces had been pushed back to South Korea, with Chinese forces entering the South Korean capital of Seoul that same day. MacArthur proposed using nuclear weapons against the Chinese, as the fallout pockets could interrupt Chinese supply lines; this proposal was rejected. In February 1951, Matthew Ridgway, the commander of the US Eighth Army, launched Operation Killer to counterattack against the Chinese, using the maximum exploitation of firepower to kill as many Chinese and KPA troops as possible. The Americans drove the communists up to the Han River, and they recaptured Seoul during Operation Ripper.
On 1 March 1951, even Mao Zedong was requesting backup from the Soviets, and Stalin sent two Soviet Air Force divisions, three anti-aircraft divisions, and 6,000 trucks to assist the Chinese and North Koreans. In April 1951, President Truman replaced the insubordinate General MacArthur with Ridgway, giving him command over all UN forces in Korea. Truman was counseled to keep the war in Korea, as an invasion of China could lead to the USA facing 500,000 Soviet troops in the Russian Far East and 85 Soviet submarines in the vicinity of Korea. In April 1951, the Chinese launched the Chinese Spring Offensive, stabilizing the battlefront and creating a situation of stalemate along the border. From July 1951 to July 1953, the Chinese and UN forces exchanged little territory, and armistice negotiations began on 10 July 1951 as the US Air Force stepped up its bombing of North Korea. Major battles were fought at Bloody Ridge, the Punchbowl, Heartbreak Ridge, Old Baldy, White Horse, Triangle Hill, Hill Eerie, Outpost Harry, The Hook, Pork Chop Hill, and Kumsong, and the stalemate continued for almost exactly two years. On 27 July 1953, a final armistice was agreed upon at Panmunjom, bringing an end to the fighting. The UN/South Korean forces lost a total of 178,405 dead, 32,295 missing, and 566,434 wounded; the communists lost 750,282 dead and 789,000 wounded.
The war was indecisive, with the ceasefire merely ending the fighting, but not bringing about permanent peace. North and South Korea are still bitter rivals, and the demilitarized zone set up between them is one of the most dangerous places in the world. US troops remain stationed in South Korea in the case of a renewed North Korean attack, and skirmishes occurred between South Korean and North Korean forces over the next few decades. The prisoners from both sides were returned, and Korea remains a bitterly divided peninsula.