Development of the line was licensed under the Bavarian law of 23 May 1846. The Royal Bavarian State Railways (Königlich Bayerische Staats-Eisenbahnen) opened the section of the Main-Spessart railway from Würzburg to the then national border with the Electorate of Hesse, which lay between Kahl am Main and Großkrotzenburg, via Aschaffenburg on 1 October 1854. It formed part of the Bavarian Ludwig Western Railway, which ran from Bamberg via Schweinfurt.