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.
Pyongbu Line
After the Pacific War and the end of Japanese rule in 1945, Korea was partitioned along the 38th parallel, with the northern half under Soviet control. This cut the line in half between Sariwŏn and Kaep'ung, with the Korean State Railway of the DPRK — initially the Soviet Army — operating trains between P'yŏngyang and Sariwŏn, and the Korean National Railroad of South Korea operating passenger trains between Seoul and T'osŏng (now Kaep'ung). On 31 December 1950 a train consisting of the locomotive "Mate 10" and 25 cars, going from Hanp'o to Munsan, was ordered to stop at Changdan by the US Army and was destroyed. The locomotive is now on display at Imjingak. The end of the Korean War established the current inner-Korean border, after which the North Korean section of the former Kyongŭi Line was split into two separate lines — the P'yŏngŭi Line from P'yŏngyang north to Sinŭiju, and the P'yŏngbu line from P'yŏngyang south to Kaesŏng, P'anmun and the DMZ.