By the early years of the 1870s, northern Switzerland had a significant network of railways, with links to the adjoining railways of Germany and France. To the west, a line had reached Brig, in the upper Rhone valley, from Lausanne. In the centre north, lines linked Olten, Lucerne, Zug and Zürich. However no line had yet reached through the Alps to southern Switzerland or the border with Italy, and all north to south rail traffic had to pass either to the west or east of Switzerland, through the Mont-Cenis, Semmering or Brenner railways.
A north-south route through Switzerland had been discussed as far back as 1848, and an international conference in Bern in 1869 had decided that the best route would be via the valleys of the rivers Reuss and Ticino, linked by a tunnel under the Gotthard Pass. The selected route was an ancient one, that had been used by pilgrims and traders since at least the 13th century.
Treaties for the construction of the line were made with the Kingdom of Italy, in 1869, and the German Empire, in 1871. The Gotthard Railway Company was incorporated in Lucerne (Canton) in 1871.
Construction of the Gotthard railway started in 1872, and the first lowland sections from Biasca to Locarno and Lugano to Chiasso were opened by 1874.