The line was built in three sections : Ansbach initially had no connection with the Ludwig South-North Railway , completed between Nuremberg and Augsburg in 1849 . It decided to finance a railway to Gunzenhausen . This was the third railway in Bavaria operated under lease by the Royal Bavarian State Railways after the Neuenmarkt – Bayreuth ( 1853 ) and Pasing – Starnberg ( 1854 ) railways . The rest of the Treuchtlingen – Würzburg line was only completed after the enactment of the '' Railway Construction Act '' of 1861 . The line was completed on 2 October 1869 with the Gunzenhausen – Treuchtlingen section , which was built as the northern part of the Altmühl Railway , which runs from Treuchtlingen through the Altmühl valley through Eichstätt to Ingolstadt . The continuous double-track line has been electrified since 15 March 1965 . In 1978 , as part of a pilot project , the operation of passenger services ended at a total of 15 stations , being replaced by bus services . Freight operation ended at many stations in 1993 . On the evening of 18 July 2016 , there was an attack on a regional train on the section between Ochsenfurt and Würzburg in which a 17-year-old Afghan refugee attacked passengers with an ax and a stabbing weapon and caused serious injuries to some of them . The perpetrator was shot by special forces during his attempted escape in the Würzburg district of Heidingsfeld . It is assumed that there may be an Islamist connection
attack on a regional train
Würzburg train attack
Treuchtlingen–Würzburg railway