information:extraction, linguistic:paraphrasing
Restoration of democracy

In 1962, a group of politicians involved in the opposition to Franco's regime inside the country and in exile met in the congress of the European Movement in Munich, where they made a resolution in favour of democracy.

With Franco's death in November 1975, Juan Carlos succeeded to the position of King of Spain and head of state in accordance with the Francoist law. With the approval of the new Spanish Constitution of 1978 and the restoration of democracy, the State devolved much authority to the regions and created an internal organisation based on autonomous communities. The Spanish 1977 Amnesty Law let people of Franco's regime continue inside institutions without consequences, even perpetrators of some crimes during transition to democracy like the Massacre of 3 March 1976 in Vitoria or 1977 Massacre of Atocha.

In the Basque Country, moderate Basque nationalism coexisted with a radical nationalist movement led by the armed organisation ETA until the latter's dissolution in May 2018. The group was formed in 1959 during Franco's rule but had continued to wage its violent campaign even after the restoration of democracy and the return of a large measure of regional autonomy.

On 23 February 1981, rebel elements among the security forces seized the Cortes in an attempt to impose a military-backed government. King Juan Carlos took personal command of the military and successfully ordered the coup plotters, via national television, to surrender.

During the 1980s the democratic restoration made possible a growing open society. New cultural movements based on freedom appeared, like La Movida Madrileña. In May 1982 Spain joined NATO, followed by a referendum after a strong social opposition. That year the Spanish Socialist Workers Party (PSOE) came to power, the first left-wing government in 43 years. In 1986 Spain joined the European Economic Community, which later became the European Union. The PSOE was replaced in government by the Partido Popular (PP) in 1996 after scandals around participation of the government of Felipe González in the Dirty war against ETA.

On 1 January 2002, Spain fully adopted the euro, and Spain experienced strong economic growth, well above the EU average during the early 2000s. However, well-publicised concerns issued by many economic commentators at the height of the boom warned that extraordinary property prices and a high foreign trade deficit were likely to lead to a painful economic collapse.

In 2002, the Prestige oil spill occurred with big ecological consequences along Spain's Atlantic coastline. In 2003 José María Aznar supported US president George W. Bush in the Iraq War, and a strong movement against war rose in Spanish society. In March 2004 a local Islamist terrorist group inspired by Al-Qaeda carried out the largest terrorist attack in Western European history when they killed 191 people and wounded more than 1,800 others by bombing commuter trains in Madrid. Though initial suspicions focused on the Basque terrorist group ETA, evidence of Islamist involvement soon emerged. Because of the proximity of the 2004 Spanish general election, the issue of responsibility quickly became a political controversy, with the main competing parties PP and PSOE exchanging accusations over the handling of the incident. The PSOE won the election, led by José Luis Rodríguez Zapatero.

In the early 2000s, the proportion of Spain's foreign born population increased rapidly during its economic boom but then declined due to the financial crisis. In 2005, the Spanish government legalised same sex marriage, becoming the third country worldwide to do so. Decentralisation was supported with much resistance of Constitutional Court and conservative opposition, so did gender politics like quotas or the law against gender violence. Government talks with ETA happened, and the group announced its permanent cease of violence in 2010.

The bursting of the Spanish property bubble in 2008 led to the 2008–16 Spanish financial crisis. High levels of unemployment, cuts in government spending and corruption in Royal family and People's Party served as a backdrop to the 2011–12 Spanish protests. Catalan independentism also rose. In 2011, Mariano Rajoy 's conservative People's Party won the election with 44.6% of votes. As prime minister, he implemented austerity measures for EU bailout, the EU Stability and Growth Pact. On 19 June 2014, the monarch, Juan Carlos, abdicated in favour of his son, who became Felipe VI.

In October 2017 a Catalan independence referendum was held and the Catalan parliament voted to unilaterally declare independence from Spain to form a Catalan Republic on the day the Spanish Senate was discussing approving direct rule over Catalonia as called for by the Spanish Prime Minister. On the same day the Senate granted the power to impose direct rule and Rajoy dissolved the Catalan parliament and called a new election. No country recognised Catalonia as a separate state.

In June 2018, the Congress of Deputies passed a motion of no-confidence against Rajoy and replaced him with the PSOE leader Pedro Sánchez. Since 2018, Spain has faced an institutional crisis surrounding the mandate of the General Council of the Judiciary (CGPJ. In January 2020, the COVID-19 virus was confirmed to have spread to Spain, causing life expectancy to drop by more than a year. In March 2021, Spain became the sixth nation in the world to make active euthanasia legal. Following the general election on 23 July 2023, Prime Minister Pedro Sánchez once again formed a coalition government, this time with Sumar (successors of Unidas Podemos).