The first public railway in present day Turkey, in fact the first railway in the Ottoman Empire, ran its inaugural train in 1858 from Alsancak station in İzmir. Sources differ as to how far it ran, and whether or not regular services began immediately afterwards. It does seem clear that regular services from İzmir at least as far as Torbalı (about 43km) were in operation by 1860. Like most subsequent railway development in Turkey, it was built to standard (1435mm) gauge. The route now forms part of the main line to Aydin.
The first railway on the European side of the Bosporus opened in 1888, connecting Constantinople (present day İstanbul) via Greece and the Balkan countries with western Europe and allowing the inauguration of the Orient Express through train from Paris the following year.
The State railway company was formed on the creation of the Republic of Turkey in 1927. The existing railways were brought under State control during the next few years. In the 1930s, although railways in European Turkey were well developed and connected to the European network, in Asia Minor coverage was much more patchy and erratic. In consequence, a new period of railway development was embarked upon.
An international link with Armenia had been effectively created in 1920 when the Kars region became definitively part of Turkey, and with it a section of the existing Russian gauge (1520mm) line from Tiflis (present day Tbilisi). However this line was to remain isolated from the rest of the Turkish network until 1939, when a 750mm gauge line was opened from Erzerum to Kars; this was converted to standard gauge in 1957. The cross border link closed in 1993 following conflicts in the Caucasus region.
A long-projected link with Iran opened in 1971. Prior to that, travel to the east had only been possible via the USSR, or via Syria and Iraq. The new route, despite the interruption of a train ferry across Lake Van, holds considerable potential as an overland freight route between Europe and Asia.
In 2013, a new train ferry service commenced between Samsun on the Black Sea and Kavkaz in Russia. In order to accommodate Russian rail vehicles, a network of 1520mm gauge lines was installed in Samsun port.
The crossing of the Bosporus at İstanbul, connecting the European and Asian parts of the rail network, was provided a train ferry until the construction of a new rail tunnel under the strait, completed in 2013 and opened for commuter services, long distance passenger and freight traffic in 2014.
An new international link with Georgia was openend in 2017. This effectively provides an alternative route to Azerbaijan and its Caspian Sea oil terminals, bypassing the closed former link via Armenia.
Flag image from CIA World Factbook