taken into service on 12 September 1840. Other sections followed: to Karlsruhe in 1843, Offenburg in 1844, Freiburg im Breisgau in 1845, Schliengen in 1847, Efringen-Kirchen in 1848 and Haltingen in 1851. The branches to Kehl and Baden-Baden were opened as early as 1844 and 1845 respectively. The extension of the main line through Basle territory required negotiations with the Swiss Confederation, during which differences of opinion over the best place for the junction of the Baden line to the Swiss network – Basle or Waldshut – led to delays. In the state treaty of 27 July 1852 an accommodation was reached which enabled the construction and operation of a line on Swiss sovereign territory by the Baden State Railways. The Baden railway lines were initially laid to the . After it turned out that all her neighbouring states had opted for rail, the Baden State Railways rebuilt all their existing routes and rolling stock to standard gauge within just one year during 1854/55. The line reached Basle in 1855, Waldshut in 1856 and Konstanz in 1863. With that the 414.3 km long Baden main line was completed. After the all-important north–south axis as well as links to the Lake Constance region had been established by the Baden Mainline, the remaining network expansion plans concentrated on opening up the area of Pforzheim with the Karlsruhe–Pforzheim–Mühlacker route (opened 1859–1863), linking up the Odenwald and Tauberfrankens with the Baden Odenwald Railway (Heidelberg–Mosbach–Würzburg, opened 1862–1866) and forging a direct link from Karlsruhe to Konstanz, without the diversion via Basle, in the shape of the Black Forest Railway (opened 1866–1873). Links to neighbouring states Even when the Baden Mainline was being built, plans were already being formulated to link up with the Swiss railway network. This was not achieved until the bridge at Waldshut over the river Rhine, built by Robert Gerwig, was completed on 18 August 1859. Other links were made in 1863 at Schaffhausen, in 1871 at Konstanz and in 1875 at Singen. The Basle link line, which connected Baden station on the east of the Rhine with the Central station west of the Rhine, was opened in 1873. Today it is the most important railway connexion between Germany and Switzerland. The connexion to the north towards Weinheim-Darmstadt–Frankfurt (Main) had been established since 1846 by the Main-Neckar Line, in which the Grand Duchy of Baden participated. In 1879 the Ried Railway (Riedbahn)