The railway lines of North Korea were originally built during the Japanese occupation of Korea by the Chosen Government Railway (Sentetsu), the South Manchuria Railway (Mantetsu) and various privately owned railway companies such as the Chosen Railway (Chōtetsu).
At the end of the Pacific War, in the territory of today's North Korea Sentetsu owned 2,879.3 km (1,789.1 mi) of railway, of which 2,466.1 km (1,532.4 mi) was standard gauge, and 413.2 km (256.8 mi) was 762 mm (30.0 in) narrow gauge; in the same territory, privately owned railway companies owned 851.5 km (529.1 mi) of rail lines, of which 678.4 km (421.5 mi) was standard gauge and 173.1 km (107.6 mi) was narrow gauge.
At the same time, in September 1945 in the future territory of the DPRK there were 678 locomotives (124 steam tank, 446 tender, 99 narrow gauge steam, and 8 electric locomotives, along with one steam-powered railway crane, 29 powered railcars, 747 passenger cars, and 6,928 freight cars.

With the official division of Korea into Soviet and American zones of occupation along the 38th parallel in August 1945,  train service on the (former) Kyŏngwŏn and Kyŏngŭi Lines was interrupted.
However, as early as 26 August, the Soviet army began operating trains on the Kyŏngŭi Line north of Sariwŏn; in the south, where the US Army Transportation Corps had taken control of the railways, service on the Kyŏngŭi Line was restarted from Tosŏng (north of Kaesŏng) to the south.
In May 1946 it was made illegal to cross the 38th parallel without a permit, and on 9 August of that year identification cards were made compulsory for rail travel in the northern part of Korea.

The beginnings of the Korean State Railway (Kukch'ŏl) as an independent entity can be traced to 10 August 1946, when the Provisional People’s Committee for North Korea nationalised all railways in the Soviet occupation zone; everything related to railway operations came under the aegis of the People's Committee for Transportation.
The railways were nearly paralysed by a lack of experienced staff as a result of the expulsion of ethnic Japanese - most railway workers, especially the skilled labourers, the locomotive crews, mechanics, engineers, and administrators, were Japanese; to make the situation worse, the Soviet Army plundered a great deal of industrial equipment from northern Korea - factory machines, components for hydroelectric dams, and a large number of locomotives and rolling stock.
Passengers resorted to riding on the infrequent freight trains, and even on locomotives.

Kukch'ŏl's actual establishment, as a department of the Ministry of Transportation of the DPRK, dates to 1948, after the formal establishment of the People's Democratic Republic of Korea.
When Kukch'ŏl was formally established that year, it had 3,767 km (2,341 mi) of railway in functional condition, including the restoration of the electrification on the Yangdŏk–Sinch'ang–Ch'ŏnsŏng section of the P'yŏngwŏn Line, and the new electrification of the Kaego–Koin section of the Manp'o Line.

On 10 December 1947, the assets of the Chosen Government Railway were formally divided between North and South, leaving the KSR with 617 steam locomotives (141 tank, 476 tender), 8 electric locomotives, and 1,280 passenger cars and 9,154 freight cars (747 and 6,928 respectively according to other sources).

Other new construction took place prior to 1950, but the Korean War which broke out on 25 June 1950 interrupted progress.
Initially, the Korean People's Army was dominant, occupying most of the Korean Peninsula apart from a small pocket around Pusan; during this time, many railway vehicles, such as DeRoI-class electric locomotives and steam locomotives built in Japan after the end of the war and delivered to South Korea as reparations, were taken to North Korea.
At the same time, war aid in the form of locomotives and freight cars arrived from friendly socialist countries such as the USSR, China, Poland, Hungary, and Czechoslovakia.
American-led United Nations forces quickly turned the tide of the war, however; by 19 October of the same year had
The railway lines of North Korea were originally built during the Japanese occupation of Korea by the Chosen Government Railway (Sentetsu), the South Manchuria Railway (Mantetsu) and various privately owned railway companies such as the Chosen Railway (Chōtetsu). At the end of the Pacific War, in the territory of today's North Korea Sentetsu owned 2,879.3 km (1,789.1 mi) of railway, of which 2,466.1 km (1,532.4 mi) was standard gauge, and 413.2 km (256.8 mi) was 762 mm (30.0 in) narrow gauge; in the same territory, privately owned railway companies owned 851.5 km (529.1 mi) of rail lines, of which 678.4 km (421.5 mi) was standard gauge and 173.1 km (107.6 mi) was narrow gauge. At the same time, in September 1945 in the future territory of the DPRK there were 678 locomotives (124 steam tank, 446 tender, 99 narrow gauge steam, and 8 electric locomotives, along with one steam-powered railway crane, 29 powered railcars, 747 passenger cars, and 6,928 freight cars.
With the official division of Korea into Soviet and American zones of occupation along the 38th parallel in August 1945,  train service on the (former) Kyŏngwŏn and Kyŏngŭi Lines was interrupted. However, as early as 26 August, the Soviet army began operating trains on the Kyŏngŭi Line north of Sariwŏn; in the south, where the US Army Transportation Corps had taken control of the railways, service on the Kyŏngŭi Line was restarted from Tosŏng (north of Kaesŏng) to the south. In May 1946 it was made illegal to cross the 38th parallel without a permit, and on 9 August of that year identification cards were made compulsory for rail travel in the northern part of Korea.
The beginnings of the Korean State Railway (Kukch'ŏl) as an independent entity can be traced to 10 August 1946, when the Provisional People’s Committee for North Korea nationalised all railways in the Soviet occupation zone; everything related to railway operations came under the aegis of the People's Committee for Transportation. The railways were nearly paralysed by a lack of experienced staff as a result of the expulsion of ethnic Japanese - most railway workers, especially the skilled labourers, the locomotive crews, mechanics, engineers, and administrators, were Japanese; to make the situation worse, the Soviet Army plundered a great deal of industrial equipment from northern Korea - factory machines, components for hydroelectric dams, and a large number of locomotives and rolling stock. Passengers resorted to riding on the infrequent freight trains, and even on locomotives.
Kukch'ŏl's actual establishment, as a department of the Ministry of Transportation of the DPRK, dates to 1948, after the formal establishment of the People's Democratic Republic of Korea. When Kukch'ŏl was formally established that year, it had 3,767 km (2,341 mi) of railway in functional condition, including the restoration of the electrification on the Yangdŏk–Sinch'ang–Ch'ŏnsŏng section of the P'yŏngwŏn Line, and the new electrification of the Kaego–Koin section of the Manp'o Line.
On 10 December 1947, the assets of the Chosen Government Railway were formally divided between North and South, leaving the KSR with 617 steam locomotives (141 tank, 476 tender), 8 electric locomotives, and 1,280 passenger cars and 9,154 freight cars (747 and 6,928 respectively according to other sources).
Other new construction took place prior to 1950, but the Korean War which broke out on 25 June 1950 interrupted progress. Initially, the Korean People's Army was dominant, occupying most of the Korean Peninsula apart from a small pocket around Pusan; during this time, many railway vehicles, such as DeRoI-class electric locomotives and steam locomotives built in Japan after the end of the war and delivered to South Korea as reparations, were taken to North Korea. At the same time, war aid in the form of locomotives and freight cars arrived from friendly socialist countries such as the USSR, China, Poland, Hungary, and Czechoslovakia. American-led United Nations forces quickly turned the tide of the war, however; by 19 October of the same year had 
Korean State Railway