Korea was ruled by Japan from 1910 until the closing days of World War II. In August 1945, the Soviet Union declared war on Japan, as a result of an agreement with the United States, and liberated Korea north of the 38th parallel. U.S. forces subsequently moved into the south. By 1948, as a product of the Cold War between the Soviet Union and the United States, Korea was split into two regions, with separate governments. Both governments claimed to be the legitimate government of all of Korea, and neither side accepted the border as permanent. The conflict escalated into open warfare when North Korean forces—supported by the Soviet Union and China—moved into the south on 25 June 1950. On that day, the United Nations Security Council recognized this North Korean act as invasion and called for an immediate ceasefire. On 27 June, the Security Council adopted S/RES/83: Complaint of aggression upon the Republic of Korea and decided the formation and dispatch of the UN Forces in Korea. Twenty-one countries of the United Nations eventually contributed to the UN force, with the United States providing 88% of the UN's military personnel.
After the first two months of war, South Korean forces were on the point of defeat, forced back to the Pusan Perimeter. In September 1950, an amphibious UN counter-offensive was launched at Inchon, and cut off many North Korean troops. Those who escaped envelopment and capture were rapidly forced back north all the way to the border with China at the Yalu River, or into the mountainous interior. At this point, in October 1950, Chinese forces crossed the Yalu and entered the war. Chinese intervention triggered a retreat of UN forces which continued until mid-1951.