A proposal was made in 1836 to build a railway line from Zürich to Basel via Laufenburg but it suffered from lack of finance and opposition in Basel. The section between Zürich and Baden opened on 9 August 1847 by the Schweizerische Nordbahn, which became known as the Spanisch-Brötli bahn. The Aargau canton government proposed a continuation of the line via Brugg and the Bözberg Pass to Basel. In 1858 the Schweizerische Centralbahn opened a line from Brugg to Olten, connecting to its Hauenstein line to Basel. At the same time the Zürich–Baden line was extended to connect with the Centralbahn's line at Brugg. Construction of an alternative route, known as the Bötzbergbahn began in 1870 and it was opened on 2 August 1875 through the Bözberg Pass from Pratteln to Brugg via the Frick valley and the 2,526-metre-long Bözberg Tunnel by a joint venture of the Centralbahn and the Nordostbahn. This line is 49 km long, about 8 kilometers shorter than the line via Olten. Trains on it used the Centralbahn between Basel and Pratteln and the Nordostbahn between Brugg and Zürich. The single-track line was built with a maximum grade of 1.4%. In 1895 the section between Pratteln and Stein-Säckingen was duplicated. No further duplications were made until the Bözbergbahn was incorporated in the Swiss Federal Railways on 1 January 1902. In November 190?, the section from Stein-Säckingen to Frick was duplicated. In April 1905 this was followed by the duplication of the Schinznach-Dorf–Brugg section and finally in September 1905 duplication was completed on the section from Schinznach-Dorf through the tunnel to Effingen and Frick. On 18 October 1926 the entire line from Pratteln to Brugg was electrified. Between Basel and Pratteln the Bözberg and Hauenstein lines share the same track. Congestion on this section was relieved by the opening of Adler Tunnel in 2003 between Liestal and Muttenz, which is now used by fast passenger trains.
Operation
Passenger services
General two inter-regional trains operate each way each hour between Zürich and Basel. One Regio S-Bahn Basel S1 service operates each way each hour between Frick and Basel, stopping at all stations. Intercity trains between Zürich and Basel operate via the faster Olten–Aarau railway and the Hauenstein line. In 1993, the local rail services between Brugg and Frick closed, and public transport on the route is now only provided by PostBus Aargau line 137 bus service. The stations at Hornussen, Effingen and Schinznach Dorf are no longer served by trains and the Villnachern station is served only two trains a day of Regio S-Bahn Basel.