The history of rail transport in Serbia began in the mid-19th century when most of the territory was still held by the Austro-Hungarian and Ottoman Empires. The first rail line on the present-day territory of Serbia was inaugurated on 20 August 1854, between Lisava-Oravica-Bazijaš and the train operated on horse-drawn traffic which were replaced in 1856 by steam locomotives. Part of the line is located in Serbia passing through Bela Crkva while the rest is in Romania. All subsequently built lines were laid towards Budapest as the territory was still part of the Austro-Hungarian Empire back then. On the territory which was under the Ottomans, the line Skopje-Kosovska Mitrovica was inaugurated in 1874. However, the major expansion began after the Berlin Congress and the independence of the, theretofore vassal to the Ottomans, Principality of Serbia during the second half of the 19th century.