Rail transport in Spain


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. The Spanish high-speed rail network is the longest HSR network in Europe with 3,973 km 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. 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. In 1900 the first line to be electrified was La Poveda-Madrid.
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 km/h, and in 1992 the Madrid-Seville high-speed line opened, beginning the process of building a nationwide high-speed network known as AVE.
The current plans of the Spanish government are to finish the standard-gauge high-speed network by building new sections of track and upgrading and converting to standard gauge the existing line along the Mediterranean coast connecting the ports of Barcelona, Tarragona, Valencia, Cartagena and Almería, to link Madrid with Vigo, Santiago and A Coruña in Galicia, to extend the Madrid-Valladolid line to Burgos and the Basque cities of Bilbao and San Sebastián, and to Hendaye on the French border, as well as to link Madrid with Lisbon and the port of Sines through Badajoz. Former plans by the Popular Party government under Prime Minister Aznar to link all provincial capitals with high-speed rail have been shelved as unrealistic, unaffordable, and contrary to all economic logic as no European funding would be made available for such projects.
Following the opening of the AVE network, the classic Iberian gauge railways have lost importance in inter-city travel, for example, the Madrid–Barcelona railway takes over nine hours to travel between the two cities stopping at every station. With the Madrid–Barcelona high-speed rail line, the longest possible journey is just three hours. 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, El Ejido, Torrevieja and Mijas. 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 ; Chiclana de la Frontera, Cádiz ; Torrent, Valencia ; Getxo, Biscay ; and Benidorm, Alicante.
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 ; 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. 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 km. The initiative is being funded through a windfall tax on banks and energy companies that have made profits from interest rates and energy prices. The tax was be introduced in 2023 and is estimated to raise up to €7 billion in two years. Money raised from the tax will also be used to build 12,000 new homes and fund youth scholarship programmes.

High speed network

High speed rail was first proposed in Spain in the 1980s, joining the Meseta Central and Andalusia. The first line, joining Madrid and Seville, was opened in 1992, in time for the Seville Expo '92. The line was built on standard gauge, and reused segments of the existing Madrid-Ciudad Real line. After that, connections with Barcelona, Valencia, Málaga and Galicia were subsequently opened. The current network is in length, the longest in Europe and the second longest in the world, after China.
The network sees a multitude of services, operated by three companies under a multitude of brands. Renfe operates services under the AVE brand for high speed long distance services, AVANT for high-speed mid distance, and ALVIA and Euromed for services that change gauges. The French operator SNCF runs international services under the inOui brand and national services under the Ouigo low-cost brand. Iryo operates several high speed services.
The current network is divided into many lines, which mostly branch out of Madrid:
  • Atlantic Corridor, which connects Madrid Chamartín station with most of the northwestern part of the peninsula. The first lines in this corridor were opened in 2011. This corridor includes lines to Galicia, Asturias and Castile and Leon. It's currently undergoing extensions to Cantabria through Palencia and to the Basque country through Burgos, both expected to open by 2027.
  • Northeast corridor, which includes the Madrid–Barcelona–French border line and the Zaragoza–Huesca branch. The Madrid-Zaragoza-Lleida segment opened in 2003, and the rest of the line was opened in stages from 2006 to 2013, when it reached the border.
  • East corridor, connecting Madrid with Valencia and Alicante through Cuenca and Albacete. First opened in 2010, with the last segment opening in 2013.
  • Mediterranean corridor, mostly under construction. It's part of the larger TEN-T Mediterranean corridor, and it runs mostly parallel to the Mediterranean coast from the port of Algeciras to the French border at Figueres. Currently, only two stretches are opened: Castelló de la Plana to Valencia in a mixed gauge configuration and Alicante to Murcia. The rest of the line is planned to open in several stages from 2025 onwards.
  • Cantabrian-Mediterranean corridor. Roughly parallel to the Ebro river, it will eventually join the Basque Country and Cantabria with the Mediterranean coast, joining the Madrid–Barcelona line at Zaragoza.
  • South corridor, which includes all lines connecting Madrid with Andalusia. This includes the Madrid–Seville line, the Córdoba–Antequera–Málaga line, the Antequera–Granada, the Seville-Cadiz line and the future Antequera–Seville line, which will connect Malaga and Granada with Seville. It also includes a spur line to Toledo.
  • The Southwest corridor, still mostly under construction, which will eventually move passengers between Madrid, Lisbon and cities in between, and which will take over the spur from Toledo as the starting point of the mainline.
Except for the Mediterranean and Cantabrian-Mediterranean corridors, all lines start from the two Madrid terminals, Atocha and Chamartin, which are connected by a crosstown tunnel.
The high speed network not only sees purely high-speed trains, as Alvia and Euromed services use gauge-changing rolling stock to be able to reach destinations not in the high speed network. As such, cities like San Sebastian and Bilbao in the Basque country, Gijón and Oviedo in Asturias or Pamplona in Navarre see services running on the high speed network for some stretches.

Operators

  • Renfe is a state-owned company which operates freight and passenger trains on the "Iberian gauge", standard gauge and rail networks of the Spanish nationalized infrastructure company ADIF. Both were formed from the break-up of the former national carrier Renfe and of FEVE.
  • Ouigo España is a subsidiary of the French company SNCF that operates long-range passenger trains on high-speed lines.
  • Iryo is the brand of ILSA, a Spanish-Italian company formed by Air Nostrum and Trenitalia that also operates long-range passenger trains on high-speed lines. Renfe, OUIGO and Iryo have all competed on several high-speed lines owned by ADIF after the liberalization of long-range passenger rail transport.
  • Euskotren operates trains on part of the narrow-gauge railway network in the Basque Country.
  • FGC operates several unconnected lines in Catalonia. It operates of narrow-gauge, of standard-gauge, and of Iberian-gauge routes, two metre-gauge rack railways and four funicular railways.
  • FGV operates several metre-gauge lines in the Valencian Community.
  • FS operates an electrified narrow-gauge railway on the Spanish island of Majorca between the towns of Palma and Sóller.
  • SFM operates the metre-gauge railway network on the Spanish island of Majorca.
  • Acciona Rail Services, a subsidiary of Acciona, operates a coal cargo line between Asturias and the province of León.
  • COMSA Rail Transport, a subsidiary of COMSA, operates a cargo line from the Port of Gijón to Valladolid.
  • Continental Rail is dedicated to bringing materials into the gorges of the high-speed lines in progress.