Gyeongui Line (1904–1945)
Following Japan's defeat in the Pacific War and the subsequent partition of Korea, the Gyeongui Line was divided at the 38th parallel between North and South Korea. On 25 August 1945, the Soviet Army began operating trains on the line north of Sariwon, whilst trains in the south terminated at Gaeseong. In 1946, the railways in both North and South were nationalised, creating the Korean National Railroad in the South and the Korean State Railway in the North. After the Korean War, the Gyeongui Line was split into three sections. In the South, the Seoul–Jangdan section became the KNR's Gyeongui Line, retaining the same name; in the North, the Bongdong–Pyeongyang section became the P'yŏngbu Line, whilst the Pyeongyang–Sinuiju section became the P'yŏngŭi Line.
North Korea–South Korea relations
The US government took the issue to the United Nations, which led to the formation of the United Nations Temporary Commission on Korea (UNTCOK) in 1947. The Soviet Union opposed this move and refused to allow UNTCOK to operate in the North. UNTCOK organised a general election in the South, which was held on May 10, 1948. The Republic of Korea 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 was declared on September 9, with Kim Il-sung, as prime minister. Soviet occupation forces left the North on December 10, 1948. US forces left the South the following year, though the US Korean Military Advisory Group remained to train the Republic of Korea Army.