<!-- "none" is a legitimate description when the title is already adequate; see WP:SDNONE -->

Rail transport in Spain operates on four rail gauges and services are operated by a variety of private and public operators. Total railway length in 2020 was 15,489 km (9,953 km electrified). The Spanish high-speed rail network is the longest HSR network in Europe with 3,973 km (2,464 mi) and the second longest in the world, after China's.

Most trains are operated by Renfe. Local publicly owned operators include Euskotren in the Basque Country, FGC in Catalonia and Serveis Ferroviaris de Mallorca in the Balearic Islands. High speed train operators other than Renfe include Ouigo and Iryo.

It is proposed and planned to build or convert more lines to standard gauge, including some dual gauging of broad-gauge lines, especially where these lines link to France, including platforms to be raised.

Spain is a member of the International Union of Railways (UIC). The UIC Country Code for Spain is 71.

History

The first railway line in the Iberian Peninsula was built in 1848 between Barcelona and Mataró. In 1851 the Madrid-Aranjuez line was opened. In 1852 the first narrow-gauge line was built; in 1863 a line reached the Portuguese border. By 1864 the Madrid-Irún line had been opened, and the French border reached.

After the Spanish Civil War, the Spanish railway system was in a state of disrepair due to the damage caused by the conflict. In 1941 RENFE was created by nationalizing the private companies that had built and until then operated the network, leading to a state-owned rail network.

By the 1950s, the Spanish rail network reached its historical maximum of almost 19,000 kilometers. However, from the mid-1950s onward, the network began to shrink due to the exponential increase in private vehicle ownership in Spain. During the Spanish economic miracle of the 1950s and 1960s, the number of private vehicles in Spain increased more than 14 times from the mid-1940s to the mid-1960s. This led to a decline in demand for rail transport and the closure of some rail lines that were no longer profitable. By 1993, almost 8,000 km of rail lines were dismantled.

The last steam locomotive was withdrawn in 1975, and in 1986 the maximum speed on the railways was raised to 160&nbsp;km/h, and in 1992 the Madrid-Seville high-speed line opened, This has allowed the conventional lines to increase focus on regional and commuter traffic, along with freight. Some lines, including the Córdoba-Bobadilla section of the classic Córdoba–Málaga railway, have lost passenger traffic completely due to the opening of AVE serving the same destinations.

Many important mainland Spanish towns remain disconnected from the rail network, the largest being Marbella with a population of over 140,000, along with Roquetas de Mar (pop. 96,800), El Ejido (pop. 84,000), Torrevieja (pop. 83,000) and Mijas (pop. 82,000). Other towns and municipalities are not on the national rail network but linked to light rail or metro systems, such as Santa Coloma de Gramenet, Barcelona (pop. 118,000); Chiclana de la Frontera, Cádiz (pop. 83,000); Torrent, Valencia (pop. 83,000); Getxo, Biscay (pop. 78,000); and Benidorm, Alicante (pop. 70,000).

Starting in Franco's regime and continuing into the 1980s, multiple lines of the Spanish rail network were closed. Campaigns for reopening former lines exist, including a reopening the branch to the aforementioned Torrevieja from the Alicante–Murcia main line; the former line from Guadix to Lorca via Baza (which would provide a direct rail link from Murcia to Granada); Plasencia to Salamanca and Gandía to Dénia.

Since 2007 the operation of freight lines was liberalised and has been open to private operators. Renfe was split in two companies (Renfe, a public company that operates freight and passenger lines, and ADIF, a public company that manages the infrastructure for all public and private operators). The same happened to FEVE, which was integrated into both of this between 2012 and 2025.

In 2020, long-distance passenger lines were likewise opened to private operators. Ouigo España began service on the Madrid–Barcelona route in 2021, joined by Iryo in 2022.

From 1 September 2022 to 30 June 2025 Spain has made free train tickets available under certain conditions. A €10 to €20 deposit must be placed and the scheme is only available on multi-trip tickets or season tickets, rather than singles. 16 or more train journeys must be made between the aforementioned dates in order to receive a full refund. The full refund is available on commuter journeys and medium-distance journeys of under 300&nbsp;km (186 miles). The Moroccan rail network is neither connected to the Iberian Peninsula (although an undersea tunnel has been proposed) nor to the Spanish autonomous cities of Melilla and Ceuta (respectively closest to the Moroccan stations of Beni Ansar and Tangier-Med).

France

Trains can cross the border at Irún–Hendaye and at Portbou–Cerbère on the conventional network, and through the Perthus tunnel on high speed trains.

The Irún–Hendaye crossing is at the western end of the Pyrenees, and has two rail lines crossing the Bidasoa River. On the mainline, trains can cross the border but have to change gauge or transfer their freight or passengers to other trains. The narrow-gauge Lezama to Hendaye line, operated by Euskotren, does cross the border, though it only has one stop on the French side next to the Hendaye mainline railway station. A high-speed rail crossing is under construction from both the Spanish and French sides, which will also allow for freight rail without changing gauge, as part of the Basque Y.

The Portbou–Cerbère crossing lies on the eastern end of the border, on the Mediterranean coast. Trains also require a transfer at either the Portbou or Cerbère stations, which are separated by a short tunnel. Both SCNF TER services and Renfe Regional and MD services cross the border.

The Perthus tunnel is the only current border crossing that doesn't break gauge. It connects the Spanish and French high speed networks, as both operate on standard gauge. It sees both passenger and cargo transit. Both SNCF and RENFE AVE trains cross the tunnel, connecting Madrid and Barcelona with Marseille, Lyon, Paris and destinations in between. With the future opening of the Montpellier to Perpignan high speed line, trains will be able to run the whole route on high speed tracks.

There used to be a third crossing at the Canfranc International railway station. The line connected Zaragoza with Pau, though it was closed in 1970 after a bridge collapse on the French side of the border. The Canfranc station currently sees two trains a day, but there are ongoing studies to reopen the line.

Portugal

As both the Portuguese and Spanish networks run on Iberian gauge, trains do not need to change gauge to cross the border. There are currently three crossings in operation, though only one train serves multiple destinations on both sides of the border.

The crossings are:

  • Tuy–Valença, over the Minho river. It sees two passenger trains a day as part of the Tren Celta route, and two regional trains between Vigo and Valença. The Tren Celta runs between Vigo and Porto, and is operated by the Portuguese national carrier CP.
  • Barca d'Alva–La Fuente de San Esteban, closed in 1985.
  • Fuentes de Oñoro–Vilar Formoso, currently in operation but without passenger service. The Surexpreso train, which joined Paris with Hendaye and Lisbon through this crossing, was suspended in March 2020.
  • Valencia de Alcántara–Beira Alta, which saw the Trenhotel Lusitania up until the closure of the Portuguese section in 2012.
  • Badajoz–Elvas, currently in operation. It currently only sees two regional trains a day, that start their service at the Portuguese station of Entroncamento and end at Badajoz.

Two new crossings for high speed trains are in different stages of development: a new Vigo-Porto crossing, which will join the Spanish Atlantic Axis with the Lisbon–Porto high-speed line and the new Lisbon-Madrid high speed rail line.

There have been proposals to build a new southern crossing over the Guadiana river, between the cities of Ayamonte and Vila Real de Santo António. Trains used to reach the river on both sides, though there was no river crossing. The Spanish line from Gibraleón to Ayamonte was closed in 1987.

Subsidies

In 2004, the Spanish government adopted a new strategic plan for transportation through 2020 called the PEIT (Strategic Plan for Infrastructures and Transport). This detailed rail subsidies of around €9.3&nbsp;billion annually on average from 2005-2020. In 2010, it rolled out a two-year plan to invest an extra €11&nbsp;billion each year for two years, as a part of a financial stimulus in response to the global downturn. In 2015, the federal budget for the railways was €5.1&nbsp;billion.

See also

  • Transport in Spain
  • High-speed rail in Spain
  • Rail transport in Europe
  • Train categories in Europe

References

  • A beginner's guide to train travel in Spain