thumb|right|Spanish Railways network thumb|right|A PCC tram build by MMC (Material Móvil y Construcciones) in Madrid in 1969, near Atocha Station. Spanish railways date from 1848. The total route length in 2017 was 15,333 km, of which 9,699 km were electrified. Four different track gauges are used in Spain.
thumb|right|Spanish Railways network thumb|right|A PC.C tram build by MMC (Material Móvil y Construcciones) in Madrid in 1969, near Atocha Station Spanish railways date from 1848. The total route length in 2017 was 15,333 km, of which 9,699 km were electrified. Four different track gauges are used in Spain.