 
High-speed railways in Spain have been in operation since 1992 when the first line was opened connecting the cities of Madrid, Córdoba and Seville. Unlike the rest of the Iberian broad gauge network, the Spanish High-speed network mainly uses standard gauge. This permits direct connections to outside Spain through the link to the French network at the Perthus Tunnel. High-speed trains run on a network of high-speed rail track owned and managed by ADIF ("Administrador de Infraestructuras Ferroviarias"), where the dominant service is AVE while other high speed services such as Avant, Alvia, Avlo, Euromed, Ouigo España and Iryo, as well as mid-speed (Altaria) services also operate.
AVE trains are operated by Renfe, the national passenger high-speed rail operator in Spain, but private companies such as Ouigo España and Iryo compete on the Madrid–Barcelona and other routes in accordance with the European Union legislation. French TGV services run from the border to Barcelona under the TGV inOui brand. Alvia and Euromed trains are also operated by Renfe and have the ability to use both Iberian gauge and standard gauge lines offering high-speed services across the whole Spanish network.
As of January 2025[ [update]], the Spanish high-speed rail network is the longest HSR network in Europe with and the second longest in the world, after China's.
History.
New rail link to Andalusia.
Towards the end of the 1980s a new line was planned to join the Meseta Central with Andalusia without passing through the Despeñaperros pass. After considering various options it was decided that a standard-gauge line, allowing for Spain's first high-speed rail link, would be built. The project was named NAFA ("Nuevo Acceso Ferroviario a Andalucía", New Rail Link to Andalusia) and was meant to help revitalise the stagnant southern Spanish economy. The line was inaugurated on 14 April 1992 to coincide with Expo 92 being held in Seville. Seven days later, on 21 April 1992 commercial AVE service began with six daily services stopping at Madrid, Seville, Córdoba, Puertollano and Ciudad Real. 
In October 1992 Renfe began the AVE Lanzadera (Shuttle), a high-speed medium distance service between Madrid, Ciudad Real and Puertollano, using spare class 100 trains. 
It has been suggested that the PSOE government chose the French Alstom bid over the Siemens and Talgo bids for political rather than technical reasons, rewarding the French government for its assistance in capturing ETA activists who took "sanctuary" across the border in southern France. Seville's hosting of the 1992 World's Fair prompted the choice of that city for the inaugural of the first high-speed line, with its being the home town of then Spanish prime minister Felipe González also playing some role. Seville was the artistic, cultural, and financial capital of southern Spain and the fourth largest city in Spain, after Madrid, Barcelona and Valencia, with a population of over 700,000 and a metropolitan area of almost 1.5 million people. It is also the capital of Andalusia, Spain's most populous autonomous community (region).
In January 1993 the "Talgo 200 Madrid–Málaga" service began, using high-speed lines as far as Córdoba and then the Córdoba–Málaga Spanish-gauge conventional track to reach Málaga. On 23 April that year, an AVE trainset set a new top speed of on a test run. Later in 1993 the mixed-method services "Talgo 200 Madrid–Cádiz" and "Talgo 200 Madrid–Huelva" began.
In 1994 AVE trains on the Madrid–Seville line began to run at 300 km/h, cutting journey times by at least 40 minutes and covering the 471 km in ;templatestyles src="Fraction/styles.css" / ;2+1⁄2 hours, though it is unlikely that much of a saving came from the increase in maximum speed, because only a small section of the line near Los Yébenes has the alignments for 300 km/h operation. The maximum permitted speed is 270 km/h between Atocha station and Brazatortas, save for the approaches to the intermediate stations (Atocha, Ciudad Real and Puertollano). Beyond Brazatortas, the line is only authorised for 250 km/h operation, which drops to 215 km/h in the Sierra Morena mountains and 90 km/h around Córdoba station. It is more likely that time savings occurred as a result of there being fewer intermediate stops.
Although in 1999 Renfe began a mixed-service "Talgo 200 Madrid–Algeciras" route, this was, along with the other mixed services, transferred to "Grandes Líneas Renfe" (Renfe's Spanish gauge long-distance brand) following changes to plans for high-speed rail in Spain.
In November 2003 a new "AVE Lanzadera" medium distance service began between Seville and Córdoba using new class 104 trains, reducing journey times between the two cities to 40 minutes. In 2005 the brand was renamed RENFE Avant, and all those services started to use trains, leaving class 100 for the AVE services. 
The construction of a stretch of high-speed line from Madrid to Toledo allowed the inauguration of a medium distance service in November 2005. The journey time between the two cities is now less than 30 minutes. The high-speed link combined with high property prices in Madrid has encouraged many Madrid commuters to settle in Ciudad Real, the first stop on the Madrid–Seville line. There has, however, been controversy over the construction of this line as the change to standard-gauge track meant that towns such as Getafe, Aranjuez and Algodor, which now have no commercial services, lost their direct services to Toledo. Furthermore, since Toledo is now connected by standard-gauge track it is impossible for other passenger or goods trains to reach it that have not come from other high-speed lines.
The last segment of the Madrid–Málaga high-speed rail line was completed on 24 December 2007 when the new high speed railway section between the cities of Córdoba and Málaga was inaugurated. It is a standard gauge railway line of 155 km in length and is designed for speeds of 300 km/h (186 mph). It has compatibility with neighbouring countries' railway systems as well.
In October 2015 an extension of the Madrid-Seville high-speed rail line to Cádiz was completed after 14 years of works and put in service by Alvia trains for speeds up to 200 km/h.
In 2019 the Antequera–Granada high-speed rail line opened at a total cost of €1.4 billion.
Madrid–Barcelona.
The Madrid–Zaragoza –Barcelona line was inaugurated on 20 February 2008, after parts of the line had operated since 2003 (Madrid–Zaragoza–Lleida) and 2006 (Lleida–Tarragona). This line is currently one of the world's fastest long-distance trains in commercial operation, with non-stop trains covering the between the two cities in just 2 hours 30 minutes, and those calling at all stations in 3 hours 10 minutes. The line includes a spur railway that branches off at Zaragoza towards Huesca in north Aragon. The Madrid-Huesca high-speed rail line was inaugurated in 2005.
The line currently terminates at Barcelona Sants railway station, but a new station is under construction at La Sagrera on the northern edge of the city. The Sants–La Sagrera tunnel links the Barcelona Sants station in Barcelona with the future Sagrera station through the Eixample district. The tunnel passes under and along the streets of Provença and Mallorca, while uses a short part under Diagonal avenue to link between these two streets. In the "Carrer de Mallorca" street, the tunnel passes directly in front of Gaudí's masterpiece, the basilica of the Sagrada Família, and in the "Carrer de Provença" street, near another Gaudí's architectural work, the Casa Milà. In a long campaign against this route, the "Board of the Sagrada Família" and other parties argued that the tunnel would damage the church, whose construction is still in progress. In this discussion about different possible routes, the one now built is also called the "Provença tunnel" because part of its route passes under the street of the same name.
The tunnel boring machine "Barcino" passed the Sagrada Família in October 2010, and reached its final destination a few months later. In March 2012, railway equipment was installed, with a special elastic isolation of the rails in order to dampen vibrations at the sections passing close to Gaudí's architectural works, using the Edilon system. Rail traffic was planned to start in 2012, initially without stops at the La Sagrera station, which was expected to be completed in 2016. The Sants–La Sagrera tunnel was finally inaugurated on 8 January 2013 along with the Perpignan–Barcelona high-speed rail line while commercial services via the tunnel towards France begun on the following day. However, works on the Sagrera station suspended in early 2014 due to a corruption scandal involving one of the companies carrying out the works. Construction works at the station were finally resumed in 2018 and the new AVE station is now expected to open to services by end 2026, while AVE trains will start passing through the station by end 2024.
Northern corridors.
The first installment of a high-speed rail corridor in the north and north-west of Spain was the 179.6 km section Madrid–Segovia–Valladolid which was put in operation on 22 December 2007. It includes a tunnel of at Guadarrama, which is the fourth longest train tunnel in Europe. Valladolid will become the hub for all AVE services connecting the north and north-west of Spain with the rest of the country. 
Construction of the extension of the line towards the region of Asturias started in 2009 (except for Pajares Base Tunnel (variante de pajares) which started in 2003) and reached the city of Leon in 2015 with the inauguration of the 162.7 km Valladolid–Venta de Baños–Leon section on 29 September 2015. On 29 November 2023 the section Leon-La Robla-Pola de Lena was inaugurated after 20 years of works On 21 May 2024 Renfe replaced the Madrid–Gijón and Castellón/Vinaros–Gijón Alvia services by AVE services on the first AVE gauge-changing Class 106 trains, able to operate at max speed with reduced journey times by 12 minutes between Madrid and Oviedo and by 10 minutes between Madrid and Gijón. 
On 24 April 2010, it was announced a 55 km high-speed spur would leave the Madrid–Valladolid route at Segovia and continue to Ávila. Initial plans were expected to be complete by the end of 2010 but as of 2024 this line remains in plans.
On 21 July 2022 a new 86.5 km section between Venta de Baños and Burgos was inaugurated after 13 years of works at an investment cost of 759 million euros and introduced a new AVE Madrid-Burgos service that cuts the journey time between the two cities down to just over an hour and a half. This section is the first expansion of the high-speed network to the north-northeast towards the Spanish region of the Basque Country and the future Basque high-speed railway line (Basque Y). It includes 2 tunnels and 12 viaducts, the longest of them passes over Pisuerga river and Autovía A-62 highway.
In the north-west of Spain the Madrid–Galicia high-speed rail line completed on 21 December 2021 after 20 years of works when the Olmedo–Zamora–Santiago de Compostela section was finished. This line is connected to the Madrid–Asturias high-speed rail line at Olmedo south of Valladolid.
Construction on the 87.1 km northernmost part of this section between the cities of Ourense and Santiago de Compostela began late 2004 and this part was inaugurated in December 2011. The 107 km southern section, between Olmedo (130 km north of Madrid on the Madrid–Asturias line) and Zamora entered revenue service on 17 December 2015 by Alvia trains. The 110 km new built section in the middle between Zamora and Otero de Sanabria near the town of Puebla de Sanabria was put in service on 26 October 2020, while the 119.4 km last remaining part between Puebla de Sanabria and Ourense which crosses some of Spain's most remote and fragile nature areas, was completed in end 2021. Up to that date the entire line was served by Alvia S-730 ("Patito", max speed ) trains.
This line is connected in the region of Galicia with the 156 km Atlantic Axis high-speed rail line that connects the cities of Vigo and A Coruña via Santiago de Compostela. Since 21 May 2024 AVE Madrid–Vigo and Madrid–La Coruña services on gauge-changing Class 106 trains are offered with reduced journey times by 18 minutes between Madrid and Santiago de Compostela and by 16 minutes between Madrid and Vigo compared to the Alvia services. 
The Atlantic Axis was inaugurated in April 2015 while the section A Coruña–Santiago de Compostela opened in 2009 and was electrified in 2011. The new railway shortened the distance between the two cities by 22 km, from 178 km to 156 km, and cut the travel time from around 3 hours on the old railway down to 1 hour and 20 minutes on the