From the beginnings till the end of World War II
With individual sections dating from the 1870s, the S-Bahn was formed by and by as the network of suburban commuter railways running into Berlin, then interconnected by the circular railway connecting the various terminal railway stations, and in 1882 enhanced by the east-west cross-city line (called the "Stadtbahn", "city railway"). The forming of a distinct identity for this network began with the establishment of a special tariff for the area which was then called the "Berliner Stadt-, Ring- und Vorortbahnen", and which differed from the normal railway tariff. While the regular railway tariff was based on multiplying the distance covered with a fixed price per kilometer, the special tariff for this Berlin tariff zone was based on a graduated tariff based on the number of stations touched during the travel.
The core of this network, that is the cross-city ("Stadtbahn") East-West line and the circular Ringbahn, and several suburban branches were converted from steam operation to a third-rail electric railway in the latter half of the 1920s. The Wannsee railway, the suburban line with the highest number of passengers, was electrified in 1932/33. A number of suburban trains remained under steam, even after the Second World War.
After building the East-West cross-city line connecting western suburban lines, which until then terminated at Charlottenburg station with eastern suburban lines which terminated at Frankfurter Bahnhof (later Schlesischer Bahnhof), the logical next step was a North-South cross-city line connecting the northern suburban lines terminating at Stettiner Bahnhof with the southern suburban lines terminating at the substations of the Berlin Potsdamer Bahnhof. The first ideas for this project emerged only 10 years after the completion of the East-West cross-city line, with several concrete proposals resulting from a 1909 competition held by the Berlin city administration. Another concrete proposal, already very close to the final realisation, was put forth in 1926 by the Breslau university professor Jenicke.Some Type 477 trains, built before World War II, remained in service until the early 21st century
Many sections of the S-Bahn were closed during the war, both through enemy action and flooding of the Nord-Süd-Bahn tunnel on 2 May 1945 during the final Battle of Berlin. The exact number of casualties is not known, but up to 200 people are presumed to have perished, since the tunnel was used as a public shelter and also served to house military wounded in trains on underground sidings. Service through the tunnel commenced again in 1947.
Before the construction of Berlin Wall
After hostilities ceased in 1945, Berlin was given special status as a "Four-Sector City, " surrounded by the Soviet Occupation Zone, which later became the German Democratic Republic (GDR). The Allies had decided that S-Bahn service in the western sectors of Berlin should continue to be provided by the Reichsbahn (DR), which was by now the provider of railway services in East Germany. (Rail services in West Germany proper were provided by the new Deutsche Bundesbahn.)