The history of rail transport in Latvia began with the construction in 1860 of a railway from Pytalovo to Dinaburg (now Daugavpils), 160 km in length, as part of the Saint PetersburgâÂÂWarsaw Railway.
More intensive development of railways in Latvia commenced the following year, 1861, when the 232 km long Riga - Dinaburg railway was opened. It connected with the Saint PetersburgâÂÂWarsaw Railway, and thus joined the Latvian railways with the Russian rail network. For the rest of the second half of the nineteenth century, the intensive construction of railways continued. Lines constructed during that period included DinaburgâÂÂRadvilià ¡kis, Mitau (now Jelgava)âÂÂMuravyovo (Maà ¾eikiai), and others.
From the 1890s, narrow gauge lines () were built to complement the broad-gauge lines (, also known as the Russian gauge). Most of the narrow-gauge railways were later converted to broad gauge, but then dismantled in the second half of the twentieth century.
During World War I, the Ober Ost German military administration built new narrow gauge and standard (European) 1435 mm gauge lines for the suppply of its forces in the territory of mainly Western and Central Latvia (Courland, Semigallia etc.). Rail lines that were converted or built in the gauge included the RigaâÂÂJelgavaâÂÂMaà ¾eikiai Railway (including the modern-day RigaâÂÂJelgava Railway), JelgavaâÂÂà  iauliaiâÂÂTilsit Railway (including the current JelgavaâÂÂMeitene Railway), the LiepÃÂjaâÂÂRomny Railway (the now-partially-abandoned ) and the PriekuleâÂÂKalÃÂtiâÂÂKlaipÃÂda Railway (the now-closed ).
During the Latvian War of Independence, the Railway High Board () of Latvia took over the maintenance and management of the Latvian railway network with its founding on 5 August 1919. The Railway High Board also founded the state-owned rail passenger company Latvijas valsts dzelzceüi (or Latvijas dzelzceüi; 'Latvian State Railways'), an indirect predecessor of the modern Pasaà ¾ieru vilciens transportation company. From 1920, the interwar independent Republic of Latvia had to rebuild the destroyed railway infrastructure and build new lines. The latter included the JelgavaâÂÂLiepÃÂja Railway, RigaâÂÂÃÂrgüi Railway and the ZemitÃÂniâÂÂSkulte (RigaâÂÂRà «jiena) Railway. In 1925, a Russian gauge second track was built along the Riga-Jelgava railway for national use along the standard-gauge track, which served as the last leg of the popular international Nord Express train line from Western Europe.
After the Soviet occupation of Latvia in 1940, the Soviet authorities dissolved the Latvian Railway High Board and transferred its assets to the Soviet railways. Plans to bring the railway system in line with the Soviet one were suspended due to the German occupation of Latvia during World War II from 1941 to 1944/1945, at the start of which all of the remaining Russian gauge railway lines in Latvia were converted into the standard gauge in around 6 months by 1942. After the start of the second Soviet occupation of Latvia in the end of World War II, all of the railway lines in Latvia were converted back to the Russian gauge, which has been the case ever since.