In November of the same year, construction on the technically challenging railway began in Stuttgart, led by the Württemberg engineer Georg Morlok. The track routing was quite complex, having to conquer steep grades and incorporating many tunnels. Much of the labor recruited by Morlok came from Italy. Construction went well: During the winter 1877/78, the line had already reached Herrenberg. On 20 August 1879, after a trial run from Stuttgart to Freudenstadt, the Royal Württemberg State Railways officially opened this section on 2 September 1879, in the presence of chief engineer Georg Morlok, the president of Württemberg Hermann von Mittnacht, the mayor of Stuttgart Gottlob Friedrich von Hack, and many other dignitaries. The construction of this section shortened the distance between Stuttgart via Horb and Tuttlingen to Immendingen by 35 kilometers, and cut the trip time by 1 to 2 hours. The Gäubahn Stuttgart–Tuttlingen–Immendingen was primarily of regional importance at this time. The terminus of all long-distance travel was Immendingen. However, by the end of the 19th century trip times were becoming quite a bit shorter, to the point where the trip between Tuttlingen and Stuttgart had been cut down to only 3 hours in 1897, 4 to 5 hours less than in the 1870s. Starting in 1900, 3 daily express long-distance trains traversed the line, some of the time from Stuttgart via Immendingen all the way to Zurich. This trip did still require that passengers change trains in Immendingen. Around the turn of the century, the Royal Württemberg State Railways mostly used the steam locomotives of the class Württemberg AD for their express service, which were in turn replaced by the class Württemberg C during World War I. The class Württemberg T 5 was used for regional service. The 9th of April 1917 saw what was probably the most famous passenger on this line, when the leader of the Russian Revolution, Vladimir Lenin, traveled from Zurich via Stuttgart to Petrograd in a special train. The line also gained in importance in terms of freight service, and in 1897 the Royal Württemberg State Railways already carried 400,000 tonnes of freight on the Gäubahn. Initially, the freight was largely made up of agricultural goods from the rich agrarian area of the Gäu, but soon industrial areas sprang up alongside the railway, which then used the Gäubahn to transport their goods.