Lenzburg transformed into the economic centre of the region in the second half of the 19th century. On 23 June 1874, Lenzburg was connected to the Aargauische Südbahn railway. On 6 September 1877 the Schweizerische Nationalbahn opened a line from Wettingen to Zofingen as part of a plan to connect Singen, Germany and Lake Geneva in competition with the established railway companies. The line went bankrupt in 1878 and was taken over by the Schweizerische Nordostbahn. The bankruptcy of the Nationalbahn brought Lenzburg to the brink of economic ruin, as the city itself was heavily involved in financing it. Paying back the city's debt took half a century.