On August 9, 1945, in the closing days of World War II, the Soviet Union declared war on Japan and advanced into Korea. Though the Soviet declaration of war had been agreed by the Allies at the Yalta Conference, the US government became concerned at the prospect of all of Korea falling under Soviet control.
The US government therefore requested Soviet forces halt their advance at the 38th parallel north, leaving the south of the peninsula, including the capital, Seoul, to be occupied by the US. This was incorporated into General Order No. 1 to Japanese forces after the surrender of Japan on August 15. On August 24, the Red Army entered Pyongyang and established a military government over Korea north of the parallel. American forces landed in the south on September 8 and established the United States Army Military Government in Korea.
As a result, two antagonistic states emerged, with diametrically opposed political, economic, and social systems. In South Korea, a general election was held on May 10, 1948. The Republic of Korea (or ROK) was established with Syngman Rhee as President, and formally replaced the US military occupation on August 15.
In North Korea, the Democratic People's Republic of Korea (or DPRK) was declared on September 9, with Kim Il-sung, as prime minister. Soviet occupation forces left the DPRK on December 10, 1948. US forces left the ROK the following year, though the US Korean Military Advisory Group remained to train the Republic of Korea Army.
The new regimes even adopted different names for Korea: the North choosing Choson, and the South Hanguk. Both opposing governments considered themselves to be the government of the whole of Korea (as they do to this day), and both saw the division as temporary.
North Korea invaded the South on June 25, 1950, and swiftly overran most of the country. In September 1950 United Nations force, led by the United States, intervened to defend the South, and following the Incheon Landing and breakout from the Busan Perimeter, rapidly advanced into North Korea.
As they neared the border with China, Chinese forces intervened on behalf of North Korea, shifting the balance of the war again. Fighting ended on July 27, 1953, with an armistice that approximately restored the original boundaries between North and South Korea. (Courtesy: Wikipedia)