A general election was held in Spain on 26 June 2016 to elect the members of the 12th 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 a repeat election under the provisions of Article 99.5 of the Constitution,. as a result of the failure in government formation negotiations following the previous general election (and the first time a nationwide election was held in Spain under this procedure).

The 2015 election had resulted in the most fragmented parliament since 1977 up to that point, with no party or bloc securing an overall majority. Parliamentary arithmetics prompted the People's Party (PP) of the acting prime minister, Mariano Rajoy, to reject an investiture bid to avoid certain defeat. The Spanish Socialist Workers' Party (PSOE) under Pedro Sánchez was invited by King Felipe VI to form a government instead, securing the support of the liberal Citizens (C's) party of Albert Rivera, but opposition by the anti-austerity Podemos leader, Pablo Iglesias, thwarted Sánchez's bid. The ensuing political deadlock and failure in government negotiations forced a repeat election being called for 26 June. Podemos joined with United Left into the Unidos Podemos alliance, along with several other minor left-wing parties. Opinion polls going into the election predicted a growing polarization between this alliance and the PP, which would be fighting to maintain first place nationally.

Despite ongoing political scandals (which had seen resignations amid the Púnica affair and the Panama leaks, and the unveiling of Operation Catalonia), the PP benefitted from the political uncertainty and increased its margin of victory, whereas the Unidos Podemos alliance unexpectedly lost support—in what was seen as voter punishment to its hardline stance during government negotiations—thwarting Iglesias's aim to overcome Sánchez's PSOE (the so-called sorpasso), which clung on to second place despite scoring a new historical low. The C's party suffered from the electoral system as well as from tactical voting to the PP, but slightly improved on the most pessimistic last-minute expectations that placed it below 30 seats. Overall, a potential PP–C's bloc gained six more seats but still remained short of a majority, whereas the prospective left-wing bloc lost ground and remained more dependant on peripheral nationalist parties than before. With a new deadlock settling in, commentators suggested that a new, third election could be eventually needed.

Electoral setbacks for the PSOE in the Basque and Galician elections in September 2016 unleashed a party crisis that led to Sánchez's ouster as leader. Party rebels appointed a provisional leadership, which chose to abstain to allow Rajoy to form a minority government amid public outcry and protest at PSOE's U-turn (which also saw a number of its lawmakers breaking party discipline and voting against Rajoy nonetheless). Rajoy's second government would only last for 20 months until June 2018, as erosion from the ensuing Catalan crisis, the emergence of new scandals and judicial blows to his ruling PP would prompt Sánchez—who would secure re-election as PSOE leader in June 2017—to bring him down in a no-confidence vote.

Background

The 2015 general election produced the most fragmented Spanish parliament since 1977, with neither of the two main alliances—the conservative People's Party (PP) with liberal Citizens (C's), or the Spanish Socialist Workers' Party (PSOE) with anti-austerity Podemos—having enough seats to form a majority without the support of peripheral nationalist parties. At the same time, the possibility of a grand coalition between PP and PSOE (unprecedented in Spain) was firmly rejected by the latter. A political deadlock followed as acting prime minister and PP leader, Mariano Rajoy, declined King Felipe VI's invitation to attempt investiture because he lacked enough support, leading to PSOE leader Pedro Sánchez being nominated instead after Podemos's Pablo Iglesias offered to join a left-wing coalition government.

Sánchez managed to fend off an internal challenge to his leadership, while a faction within the PSOE discouraged any pact with Podemos because of the party's sympathies to the Catalan independence movement. The PSOE also rejected Podemos's demands for ministerial posts and its condition that C's be excluded from negotiations. In the end, Sánchez reached an agreement with Albert Rivera in an attempt to outmanoeuvre Iglesias and garner cross-party support, despite the alliance controlling only 130 of the 350 seats in Congress. This PSOE–C's deal was rejected by Podemos as incompatible with its programme, leading to a breakdown in negotiations. With opposition from all other parties, Sánchez's investiture bid was defeated 219–131 on 4 March 2016.

Concurrently, corruption scandals continued to affect the ruling PP. One party lawmaker was expelled over a kickbacks-for-contracts scheme, while an investigation into alleged bid rigging at the state-run water contract company Acuamed led to the resignation of the presidency undersecretary. The party's Valencian branch was also accused of widespread corruption in the so-called Taula affair involving dozens of politicians, including figures close to former Valencia mayor Rita Barberá. The Púnica affair brought a police raid on the PP's headquarters in Madrid over illegal financing allegations and led to Esperanza Aguirre's resignation as regional party leader. April 2016 saw the arrest of the PP mayor of Granada in a real-estate corruption probe; the resignation of the industry minister, José Manuel Soria, after being implicated in the Panama leaks; and former prime minister José María Aznar being ordered to pay €270,000 in fines and back taxes. In June 2016, leaked recordings implicated the interior minister, Jorge Fernández Díaz, in an alleged plot to fabricate scandals against pro-Catalan independence politicians. Rajoy's caretaker government was also taken to court for refusing parliamentary oversight, while reports that Spain had missed its 2015 deficit target forced him to acknowledge the need for further austerity measures to meet European Union requirements.

After Sánchez's failed investiture, the PSOE tried to secure at least Podemos's abstention. Internal divisions emerged within Podemos between supporters of Iglesias's hardline negotiating stance () and those aligned with his deputy Íñigo Errejón (), who favoured allowing a PSOE-led government; this conflict led to several resignations in the party's Madrid branch. Attempts to form a three-way agreement with C's failed because of deep mutual distrust, while Rajoy kept dismissing the possibility of forming a government himself under the existing parliamentary numbers. A last attempt by the Valencianist party Compromís to form a left-wing coalition of independents was also rejected by Podemos, ultimately leading to a snap election being called for 26 June 2016 amid mutual accusations among the parties.

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 The term of each chamber of the —the Congress and the Senate—expired four years from the date of their previous election, unless they were dissolved earlier.. The election decree was required to be issued no later than 25 days before the scheduled expiration date of parliament and published on the following day in the Official State Gazette (BOE), with election day taking place 54 days after the decree's publication.. The previous election was held on 20 December 2015, which meant that the chambers' terms would have expired on 20 December 2019. The election decree was required to be published in the BOE no later than 26 November 2019, setting the latest possible date for election day on 19 January 2020.

The prime minister had the prerogative to propose the monarch to dissolve both chambers at any given time—either jointly or separately—and call a snap election, provided that no motion of no confidence was in process, no state of emergency was in force and that dissolution did not occur before one year after a previous one.. Additionally, both chambers were to be dissolved and a new election called if an investiture process failed to elect a prime minister within a two-month period from the first ballot.. Barring this exception, there was no constitutional requirement for simultaneous elections to the Congress and the Senate. summarizing . Still, as of , there has been no precedent of separate elections taking place under the 1978 Constitution.

Following Sánchez's nomination as investiture candidate, the president of the Congress of Deputies, Patxi López, initially scheduled the first ballot for 3 March 2016; however, this date was moved forward to 2 March so that a hypothetical repeat election was held on 26 June (a Sunday) rather than on 27 June (Monday).

The were officially dissolved on 3 May 2016 with the publication of the corresponding decree in the BOE, setting election day for 26 June and scheduling for both chambers to reconvene on 19 July..

Electoral system Voting for each chamber of the was based on universal suffrage, comprising all Spanish nationals over 18 years of age with full political rights, provided that they had not been deprived of the right to vote by a final sentence, nor were legally incapacitated.. Additionally, non-resident citizens were required to apply for voting, a system known as "begged" voting ()..

The Congress of Deputies had a minimum of 300 and a maximum of 400 seats, with electoral provisions fixing its size at 350. Of these, 348 were elected in 50 multi-member constituencies corresponding to the provinces of Spain—each of which was assigned an initial minimum of two seats and the remaining 248 distributed in proportion to population—using the D'Hondt method and closed-list proportional voting, with a three percent-threshold of valid votes (including blank ballots) in each constituency. The remaining two seats were allocated to Ceuta and Melilla as single-member districts elected by plurality voting.; . The use of this electoral method resulted in a higher effective threshold depending on district magnitude and vote distribution.

As a result of the aforementioned allocation, each Congress multi-member constituency was entitled the following seats:.

Seats Constituencies 36 Madrid 31 Barcelona 16 Valencia 12 Alicante, Seville 11 Málaga 10 Murcia 9 Cádiz 8 A Coruña, Asturias, Balearic Islands, Biscay, Las Palmas 7 Granada, Pontevedra, Santa Cruz de Tenerife, Zaragoza 6 Almería, Badajoz, Córdoba, Gipuzkoa, Girona, Tarragona, Toledo 5 Cantabria, Castellón, Ciudad Real, Huelva, Jaén, Navarre, Valladolid 4 Álava, Albacete, Burgos, Cáceres, La Rioja, León, Lleida, Lugo, Ourense, Salamanca 3 Ávila, Cuenca, Guadalajara, Huesca, Palencia, Segovia, Teruel, Zamora 2 Soria