Since the opening of the Suez Canal in 1869, the Cisleithanian government of Austria-Hungary had urged for a direct connection of the restored main Austrian seaport at Trieste with the Bohemian coalfields and iron works in the northern parts of the Monarchy. After lengthy discussions, the building of the Tauernbahn was set up as a part of the larger "New Alpine Railways" investment project, pushed by the newly established k.k. Railway Ministry under Heinrich von Wittek from 1901 onwards.
Construction of the Tauern Tunnel began on 24 June 1901, the northern ramp from Schwarzach-St. Veit was built from 1902 onwards. Significant construction cost overruns triggered fierce debates in the Austrian Imperial Council, nevertheless on 20 September 1905 the first section of the line up to Bad Gastein station was ceremonially opened by Emperor Franz Joseph I, Minister-President Paul Gautsch von Frankenthurn, and Archbishop Cardinal Johannes Katschthaler. The southern ramp down to Spittal an der Drau was erected from 1906 under the supervision of the Viennese engineer and entrepreneur Wilhelm Carl Gustav von Doderer, father of the writer Heimito von Doderer. The railway line was completed in 1909 and inaugurated by the emperor at Spittal station on 5 July.
The tunnel itself had been built double-track, the northern and southern sections only single-track. The Obervellach station near the southern tunnel exit, situated on a slope 365 m (1,198 ft) above the village, from 1931 could be reached by a cable car, that was dismantled in 1976. In 1999 the Obervellach station was finally abandoned and relocated to Mallnitz. In 1933-35 the Tauern Railway line was completely electrified. From 1969 onwards further sections were restored to double track including several new passages, viaducts and straightenings to cope with the high traffic load and to allow higher travelling speeds. The southern ramp down to Pusarnitz was completed double-track in 2009, while parts of the former track bed between Mallnitz and Obervellach were turned into a hiking trail. A new double-track bridge in the Gastein valley was put into operation in 2016.
Since 1920 car shuttle trains (Tauernschleuse) through the Tauern Tunnel ply between the stations of Bad Gastein-Böckstein and Mallnitz. Up to World War II, the Tauern Railway mainly served Austrian domestic rail service, with a few links to Yugoslavia (Zagreb, Belgrade, and the Adriatic coast). After the war, the number of international train services to Southeast Europe increased as the main route via Bratislava and Budapest was blocked by the Iron Curtain. From 1951 to 1988 the Tauern-Express ran from Ostend to Yugoslavia, including through coaches to Athens and Istanbul, frequently used by migrant workers (Gastarbeiter) in West Germany.
Long-distance services have decreased since the Yugoslav Wars in the 1990s, and by competition from expanded road connections and cheaper flights. Today the Tauern Railway provides EuroCity service to Zagreb and ÖBB InterCity connections link Salzburg with Klagenfurt, partially served by Railjet trains.
Eckert, Klaus; Kowarik, Gerald; Moll, Gerfried (2009). Tauernbahn - Österreichs moderne Alpenbahn (in German). Europmedia-Verlag. ISBN978-3-940262-03-5.
Löffler, Detlef (2009). Posch, Christoph (ed.). Jahre Tauernbahn – das waghalsige Unterfangen, eine Eisenbahnlinie über die Tauern in den Süden zu bauen. Hundert Jahre imposante Ingenieurskunst, die heute noch ihresgleichen sucht (in German). Vienna: Art Quarterly Publishing House. ISBN978-3-9502841-0-2.
Horn, Alfred (2008). Infrastrukturbauten, Fahrzeugbau, ausländische Triebfahrzeuge in Österreich, Einstellungen, Stillegungen in Niederösterreich. Eisenbahn-Bilderalbum (in German). Vol. 12. Vienna: Bohmann Verlag. ISBN978-3-901983-81-8.
Eisenbahnatlas Österreich [Railway atlas of Austria]. Schweers + Wall. 2010. ISBN978-3-89494-138-3.