Spain is a young democracy: the first free elections after the dictatorship were held on 15 June 1977. Since then the country has had eight prime ministers, a long period of two-party politics and, after the 2008 crisis, a fragmentation that makes stable majorities hard to form. For how the institutions work, see the Spanish state.
The Transition
The first elections were won by the Union of the Democratic Centre (UCD) of Adolfo Suárez, the former Francoist official who steered the dismantling of the regime and the drafting of the 1978 Constitution, with the agreement of the main parties, communists included. The young democracy survived the attempted coup of 23 February 1981 (see the royal family).
The two big parties
In 1982 the Spanish Socialist Workers' Party (PSOE), founded in 1879, won a landslide under Felipe González, who governed until 1996: the years of joining the European Community and NATO, of modernisation, the Barcelona Olympics and the Seville Expo, but also of scandals such as the GAL affair, the "dirty war" against ETA.
The centre-right reorganised into the Partido Popular (PP), born in 1989 from the old Alianza Popular founded by former Francoist ministers. Under José María Aznar, the PP moved to the centre and won the 1996 and 2000 elections: years of strong growth, liberalisation, joining the euro, falling unemployment and support for the Iraq war.
11 March 2004 and Zapatero
On 11 March 2004, three days before the election, ten bombs exploded on four commuter trains in Madrid, at Atocha station and nearby: 193 people died and over 1,800 were injured. It was the worst terrorist attack in recent European history, carried out by a jihadist cell. Aznar's government initially blamed ETA, and its handling of the crisis contributed to the victory of Socialist José Luis Rodríguez Zapatero.
Zapatero immediately withdrew troops from Iraq and passed major social reforms: same-sex marriage with adoption rights (2005), fast-track divorce, the gender equality law, with a government half made up of women, the law against gender violence, the historical memory law for victims of the civil war and Francoism, the points-based driving licence and the smoking ban in public places. Re-elected in 2008, he was swept away by the economic crisis (see the 2008-2012 crisis) and stepped down early.
Rajoy, the crisis and Catalonia
In 2011 Mariano Rajoy's PP won an absolute majority and tackled the crisis with heavy spending cuts and a labour reform. In October 2011 ETA, the Basque terrorist group responsible for over 850 deaths since 1968, announced the definitive end of its armed struggle, and in 2018 it dissolved. Meanwhile, the indignados protest of 15 May 2011 gave rise to new parties, such as Podemos on the left and Ciudadanos in the centre.
In 2017 Carles Puigdemont's Catalan government held an independence referendum declared illegal on 1 October, and on 27 October the Catalan parliament declared independence: the government suspended Catalonia's autonomy under Article 155 of the Constitution, and several independence leaders were tried or fled abroad (see Catalonia).
The Sánchez era
In June 2018, after a corruption ruling involving the PP, Socialist Pedro Sánchez brought Rajoy down with the democracy's first successful no-confidence motion. After two elections in 2019, he formed the first coalition government since the Transition, with Unidas Podemos, and renewed it after the 2023 vote with Sumar, led by Yolanda Díaz, thanks to support from Catalan and Basque parties in exchange for an amnesty for those responsible for the independence process, passed in 2024. Meanwhile Vox, a radical-right party led by Santiago Abascal, has grown, while the PP is led by Alberto Núñez Feijóo. In October 2026 Sánchez called a snap election for 29 November (see elections and Spain today).