Slovenian Railways (Slovene: Slovenske železnice, SŽ) is the state railway company of Slovenia, created in 1991 from the Ljubljana division of the former Yugoslav Railways after the breakup of Yugoslavia.
Slovenia is a member of the International Union of Railways (UIC). The UIC Country Code for Slovenia is 79.
Slovenia received its first railway connection in the 1840s, when the Austrian Empire built a railway connection - Südliche Staatsbahn or Austrian Southern Railway - between its capital, Vienna, and its major commercial port, Trieste. Thus, Maribor was connected by railway to Graz in 1844. The stretch was extended via Pragersko to Celje in 1846, and further via Zidani Most to Ljubljana in 1849. A double-track line was continued via Postojna, Pivka, and Divača, finally reaching Trieste in 1857.
Before World War I, numerous other railways were built. In 1860, Pragersko was connected to Ormož and further to Čakovec, Croatia, thus connecting the Austrian and the Hungarian part of the empire. In 1862, a single-track railway (expanded into double-track in 1944) along the Sava river was built, connecting Zidani Most with Zagreb. In 1863, the "Carinthian railway" was built along the Drava river, connecting Maribor with Dravograd, Klagenfurt and Villach. In 1870, a railway along the upper Sava river valley was built, connecting Ljubljana with Kranj, Jesenice and Tarvisio, Italy. In 1873, a line from Pivka via Illirska Bistrica connected Rijeka, then the most important commercial port in the Hungarian part of the empire. In 1876, a line from Divača connected Pula, the Austrian naval base, via Prešnica. In 1906, Bohinj Railway was built, connecting Villach with Jesenice, along the Soča river valley to Gorizia and further to Trieste, with two over-6000 meter tunnels.