The history of rail transport in Slovakia began in November 1836, at the founding meeting of the participating companies for the construction of a horse railway from Bratislava to Trnava (later extended to Sereď). The first section of that railway was launched on 27 September 1840.
The first locomotive powered railway in today's Slovakia was constructed by the Hungarian "Northern Railway Company" on the Bratislava–Marchegg–Gänserndorf (–Vienna) line, commissioned on 20 August 1848.[1] By 1872, upon the completion of the Košice–Bohumín Railway, railways linked one end of Upper Hungary with the other.
Following the Austro-Hungarian Compromise of 1867 that created the Dual Monarchy of Austria-Hungary, transport issues became the responsibility of the Hungarian Government, which also inherited the duty to support local railway companies. This came at a considerable cost: in the 1874 fiscal year 8% of the annual budget went to railway company subsidies. This led the Hungarian Parliament to consider founding a State Railway in 1868.
The goal was to take over and operate the Hungarian main lines. The branch lines were constructed by private companies. When the law in 1884 provided a simplified way to create railway companies many small branch line companies were founded. These, however, usually only constructed the lines, then made a contract with MÁV to operate them. Thus they also owned no locomotives or other rolling stock. MÁV made a contract only if the line, its equipment and buildings were constructed to MÁV standards. This helped to build standard station buildings, sheds, and accessories, all to the MÁV rules.
Because of relatively high prices the traffic density was considerably lower in the Kingdom of Hungary than in other countries. To change this the Interior Minister, Gábor Baross, introduced the zone tariff system in 1889. This system resulted in lower prices for passenger trips and goods transport but it induced a rapid increase in both and so higher overall profits. In 1891 the Hungarian lines of the StEG were bought by the Hungarian State directly from the French owners and became MÁV lines.
In 1890 most large private railway companies were nationalized as a consequence of their poor management, except the strong Austrian-owned Kaschau-Oderberg Railway (KsOd) and the Austrian-Hungarian Southern Railway (SB/DV). They also joined the zone tariff system, and remained successful until the end of World War I when Austria-Hungary collapsed.
By 1910 MÁV had become one of the largest European railway companies, in terms of both its network and its finances. Its profitability, however, always lagged most Western European companies, be they publicly or privately owned. The Hungarian railway infrastructure was largely completed in these years.
By 1910, the total length of the rail networks of the Hungarian Kingdom reached 22869km (14,210miles), the Hungarian network linked more than 1,490 settlements. Nearly half (52%) of the Austro-Hungarian Empire's railways were built in Hungary, thus the railroad density there became higher than that of Cisleithania. This has ranked Hungarian railways the 6th most dense in the world (ahead of countries as Germany or France).[2]
After World War I and the Dissolution of Austria-Hungary and the Treaty of Trianon Upper Hungary became part of the First Czechoslovak Republic and with it the countries northern railway lines.