A general election was held in Spain on 23 July 2023 to elect the members of the 15th Cortes Generales under the Spanish Constitution of 1978. All 350 seats in the Congress of Deputies were up for election, as well as 208 of 266 seats in the Senate. It was the first time since 1839 that a general election in Spain was held in the month of July.

The second government of Pedro Sánchez formed after the November 2019 election consisted of a left-wing coalition between the Spanish Socialist Workers' Party (PSOE) and Unidas Podemos, the country's first such nationwide government since the Second Spanish Republic. Its tenure was quickly overshadowed by the outbreak of the COVID-19 pandemic in March 2020, along with its political and economic consequences (including a recession resulting from the extensive lockdowns implemented to curb the spread of the SARS-CoV-2 virus), as well as the impact of the Russian invasion of Ukraine (which aggravated an ongoing inflation surge) and the 2021 volcanic eruption in La Palma. The opposition People's Party (PP) saw party leader Pablo Casado being replaced by the Galician president, Alberto Núñez Feijóo, after an internal push in February 2022 by Madrilenian president Isabel Díaz Ayuso (a rising star within the party following her 2021 regional election victory). Far-right Vox had been supporting PP-led cabinets at the regional and local level in exchange for programmatic concessions and—eventually—government participation; whereas the liberal Citizens party, which had lost most of its support since 2019, chose not to run.

Despite speculation about a snap election, Prime Minister Pedro Sánchez consistently expressed his intention to complete his term as scheduled in 2023, after the Spanish presidency of the Council of the European Union. Poor results of the left-wing bloc in the 2023 local and regional elections, with losses to the PP and Vox in all but three regions, led to a surprise early dissolution of parliament in what was described as a gamble by Sánchez to wrong-foot the opposition and prevent a six-month lame duck period. In the closest election since 1996, the PP saw the biggest increase in support and secured 137 seats in the Congress, but fell short of opinion polling expectations. The PSOE placed second and overperformed polls by improving upon previous results, gaining over one million votes and scoring its best result since 2008 in terms of votes and vote share. Vox saw a decrease in support, while the Sumar platform under the second deputy prime minister, Yolanda Díaz—the successor of the Unidas Podemos alliance after the resignation of Pablo Iglesias in 2021—won 31 seats in the Congress.

As neither bloc achieved a majority, the balance of power was held by the Together for Catalonia (Junts) party of former Catalan president and fugitive Carles Puigdemont, despite electoral losses by Catalan independence parties. Following a failed Feijóo attempt to secure investiture in the ensuing government formation process, Sánchez struck a deal with Junts—in exchange for a controversial amnesty bill which sparked protests—and most of the parliamentary regionalist and peripheral nationalist parties, securing re-election on 16 November with an absolute majority: the first time since 2011 that a repeat election was not needed and that a candidate was elected in the first ballot of investiture.

Background

The outcome of the November 2019 general election saw the Spanish Socialist Workers' Party (PSOE) and the Unidas Podemos setting aside their differences and reaching a preliminary government deal within days. After securing the consent of the Republican Left of Catalonia (ERC)—despite tensions following the Spanish Supreme Court's prison sentences to Catalan independence leaders and the Spanish government's handling of the October 2019 protests—Pedro Sánchez was re-elected prime minister in January 2020, forming Spain's first nationwide coalition cabinet since the Second Republic, with Podemos leader Pablo Iglesias as second deputy prime minister.

From March 2020, Sánchez's second government dealt with the outbreak of the COVID-19 pandemic, declaring a state of alarm and enforcing a nationwide lockdown to curb the spread of the virus ("flattening the curve"). The National Health System was quickly overwhelmed and the country saw high infection and death rates, especially in nursing homes. The sudden halt of non-essential economic activity triggered a recession, prompting the government to approve several relief packages collectively known as the "social shield". Anti-lockdown protests emerged in May 2020 in the Madrid region (the hardest hit by the pandemic), particularly in its wealthiest areas. Although restrictions were lifted by the summer, later waves of infections led to new limits and curfews, including a partial lockdown of Madrid in September 2020 and a six-month state of alarm that gave regions more control over restrictions. The authorities' initial response was widely criticized as slow and ineffective, and in 2021 a divided Constitutional Court ruled the two states of alarm unlawful, arguing that a state of exception—requiring prior, rather than later, parliamentary approval to enforce lockdowns—should have been used instead.

Spain became the second-largest recipient of the Next Generation EU recovery funds after successful negotiations, and the government presented a national plan focused mainly on energy and digital transitions. This period also saw reconstruction efforts in La Palma after the 2021 Cumbre Vieja volcanic eruption; Spain's participation in military aid to Ukraine following the 2022 Russian invasion; and an inflation surge that triggered a global energy crisis, which saw the European Commission granting Spain a temporary mechanism to cap gas prices (the "Iberian exception"). Other major events included the 2021 Morocco–Spain border incident and the subsequent 2022 Melilla incident (in which 37 migrants died in a crowd crush), a March 2022 decision by Sánchez's government to accept the Western Sahara autonomy proposal, the 2022 NATO summit in Madrid, and Spain's presidency of the Council of the European Union in 2023. A major cabinet reshuffle in July 2021 saw the departure of several senior PSOE figures such as Carmen Calvo and José Luis Ábalos from the government.

In an attempt to ease tensions from the 2017–2018 Catalan crisis, Sánchez granted partial pardons to jailed pro-independence leaders in June 2021. His government also passed a major labour market reform (limiting temporary employment and strengthening collective bargaining) in a narrow 175–174 vote, seeing a decisive voting mistake by a PP member. Social reforms saw the legalization of euthanasia, the "Trans Law" allowing gender self-identification, and a reform of the abortion law that expanded rights and introduced paid menstrual leave. A new Education Law (the LOMLOE) was approved to reduce school segregation and limit grade retention, while a Democratic Memory Law sought to increase justice for victims of Franco's dictatorship. Animal welfare legislation was expanded, though the exclusion of hunting dogs and bullfighting drew criticism. Among the most controversial bills were an overhaul of the sedition and embezzlement offences—seen by the right-wing opposition as a concession to Catalan parties—and the "Only Yes Means Yes" sexual consent law, which contained a loophole that led to reduced sentences for hundreds of offenders. Concurrently, the ongoing blockade of the judiciary council (which stalled judicial appointments for years) prompted attempts at judicial reform, which triggered an institutional crisis in December 2022 when the Constitutional Court temporarily blocked the passage of the proposed legislation.

Seeking to counter competition from the far-right Vox party under Santiago Abascal and to attract former Citizens (Cs) voters, the opposition People's Party (PP) adopted a confrontational stance toward Sánchez. The Madrid regional government of Isabel Díaz Ayuso—criticized for its triage protocols and selective lockdown measures during the pandemic—frequently clashed with the national government. Ayuso's polarizing profile made her one of Sánchez's main political rivals, culminating in a snap Madrid election in May 2021 in which she achieved a decisive victory and severely weakened Cs. This success also triggered a conflict with PP leader Pablo Casado over control of the regional party, which escalated after disappointing results in the 2022 Castilian-Leonese election and Ayuso's subsequent accusations that Casado was trying to undermine her through a smear campaign. The crisis eventually led to Casado's removal and the election of the Galician president, Alberto Núñez Feijóo, as new PP leader in a show of unity. This period also saw the exposure of new corruption scandals during Rajoy's premiership: the so-called Kitchen affair (an alleged police espionage and deep state network operated by the interior ministry), and a large blackmail and tape-recording network operated by former police officer José Manuel Villarejo.

Having influence over several regional PP–Cs governments formed after the 2019 regional elections, Vox pushed for some of its most controversial proposals, including a "parental pin" in Murcia (allowing parents to veto school activities they considered "contrary to moral principles"), and an anti-abortion plan in Castile and León that would have required doctors to pregnant women the chance to hear the fetal heartbeat or undergo a 4D ultrasound (ultimately dropped to prevent a constitutional conflict). Amid growing political polarization, and seeking to capitalize on anti-lockdown protests and public anger at the Spanish government, Vox tabled two no-confidence motions against Sánchez in 2020 and 2023. Both failed by wide margins, but they highlighted the PP's shift from outright opposition under Casado in the first to a conciliatory abstention under Feijóo in the second.

Pablo Iglesias resigned from the government to run against Ayuso in the 2021 Madrid election, but his poor result led him to leave politics. Labour minister Yolanda Díaz then emerged as his likely successor as his alliance's candidate for prime minister, using her popularity to reorganize Unidas Podemos by bringing together several left-wing parties—such as En Comú Podem, Compromís and Más Madrid/Más País—under the Sumar umbrella. The Tito Berni affair in March 2023 (a cash-for-favours scheme involving a PSOE lawmaker from the Canary Islands), controversy over the pro-Basque independence EH Bildu party including former ETA members on its candidate lists, and a vote-buying scandal (particularly affecting Melilla), complicated the political landscape and contributed to losses for left-wing parties in the May 2023 local and regional elections. This prompted Sánchez to call a surprise snap election for 23 July, a move widely seen as an attempt to catch the opposition off guard and avoid a prolonged lame-duck period.

Overview Under the 1978 Constitution, the Spanish were conceived as an imperfect bicameral system.. summarizing . The Congress of Deputies held greater legislative power than the Senate, having the ability to grant or withdraw confidence from a prime minister and to override Senate vetoes by an absolute majority.. Nonetheless, the Senate retained a limited number of specific functions—such as ratifying international treaties, authorizing cooperation agreements between autonomous communities, enforcing direct rule, regulating interterritorial compensation funds, and taking part in constitutional amendments and in the appointment of members to the Constitutional Court and the General Council of the Judiciary—which were not subject to override by Congress..

Date