The first railway in Bosnia opened in 1878, a standard (1435mm) gauge line between Banja Luka and Prijedor constructed by the Ottoman Empire. However, railway development started in earnest in the following year with the opening of the 96km line from Srpski Brod to Doboj, the first section of a line to Sarajevo. It was built to 760mm gauge, and as such was the first narrow gauge line constructed in the Austro-Hungarian Empire. Subsequent construction was mostly to this gauge, the network reaching its peak by the end of the First World War. Many of the lines were converted to standard (1435mm) gauge during the reconstruction of the then Yugoslavia following the Second World War, and most of the remaining narrow gauge lines were closed.
The present day network has international connections with Croatia and Serbia.
Bosnia and Hercegovina is a federation of two main territories, each with own railway administration.
The flag shown on this page was imposed by the United Nations in 1998, but is little used within the country, each territory preferring its own specific flag.