In the 1830s a commission was established on behalf of
King William I of Württemberg to investigate whether a railway would be a suitable means to connect the
Neckar with
Lake Constance and to expedite the movement of goods in
Württemberg. For the
Eastern Railway (
Ostbahn) from Stuttgart to Ulm, the experts examined both a route along the
Rems and
Brenz, as well as along the
Fils. Although the escarpment of the
Swabian Alb posed a difficult obstacle to overcome for the Fils route, it was selected in preference to a route along the Brenz because it did not need to pass through Bavaria. The so-called Brenz railway clause was historically important for the railways. This was part of a treaty contracted on 21 February 1861 between the kingdoms of
Bavaria and Württemberg in relation to the continuation of the
Rems Railway (
Remsbahn) between
Stuttgart and
Wasseralfingen to the border near
Nördlingen and the connection to the Bavarian network. Bavaria's agreement for this link depended on Württemberg agreeing that for twelve years from the date of opening of the
Cannstatt–Nördlingen line no rail connection would be opened between it and the
Cannstatt-Ulm line on the route of the eventual Brenz Railway. The reason was that the connection from Nördlingen to the Württemberg shore of Lake Constance (at
Friedrichshafen) would have been shorter than the connection on the Bavarian side (to
Lindau). in 1902 Construction of the Brenz Railway started on the basis of a Württemberg law of 17 November 1858. The construction between
Aalen and
Heidenheim began in 1862. Although planned for two tracks—this can still be seen at various bridgeheads—it opened as a single track. The only tunnel is through the Brünneleskopf (between Schnaitheim and Itzelberg) and is 257.1 metres long. Two years later, on 12 September 1864, the Brenz line was formally opened to Heidenheim. The line was extended to
Niederstotzingen on 25 July 1875 and to
Langenau on 15 November 1875. Construction continued of the line to Ulm only in 1875, after the expiration of the Brenz railway clause and on the basis of a new Wurttemberg–Bavaria treaty of 8 December 1872. This section was opened on 5 January 1876. From 1 May 1911 to 1956 there was a connecting line from
Sontheim to
Gundelfingen in Bavaria on the
Ingolstadt–Neuoffingen railway. ==Development ==