1987 Madrilenian regional election

The 1987 Madrilenian regional election was held on Wednesday, 10 June 1987, to elect the 2nd Assembly of the Autonomous Community of Madrid. All 96 seats in the Assembly were up for election. The election was held simultaneously with regional elections in twelve other autonomous communities and local elections all throughout Spain, as well as the 1987 European Parliament election.

The Spanish Socialist Workers' Party (PSOE) under Joaquín Leguina lost its overall majority in the Assembly, but remained the largest party. The most notable election result was the Democratic and Social Centre (CDS) breakthrough, emerging as the third largest party at the expense of all other parties in the regional parliament. The People's Alliance (AP) of newly elected AP Madrid leader Alberto Ruiz-Gallardón remained static, maintaining its position as the second largest party, while United Left (IU), a coalition of the Communist Party of Spain and other left-wing political forces, slipped to fourth place.

In the aftermath of the election, the CDS chose to abstain in the investiture voting in order to allow the PSOE to continue to govern in minority.

Electoral system
The Assembly of Madrid was the devolved, unicameral legislature of the autonomous community of Madrid, having legislative power in regional matters as defined by the Spanish Constitution and the Madrilenian Statute of Autonomy, as well as the ability to vote confidence in or withdraw it from a President of the Community. Voting for the Assembly was on the basis of universal suffrage, which comprised all nationals over 18 years of age, registered in the Community of Madrid and in full enjoyment of their political rights.

All members of the Assembly of Madrid were elected using the D'Hondt method and a closed list proportional representation, with an electoral threshold of five percent of valid votes—which included blank ballots—being applied regionally. The Assembly was entitled to one member per each 50,000 inhabitants or fraction greater than 25,000.

The electoral law provided that parties, federations, coalitions and groupings of electors were allowed to present lists of candidates. However, groupings of electors were required to secure the signature of at least 0.5 percent of the electors registered in the Community of Madrid. Electors were barred from signing for more than one list of candidates. Concurrently, parties and federations intending to enter in coalition to take part jointly at an election were required to inform the relevant Electoral Commission within ten days of the election being called.

Election date
The term of the Assembly of Madrid expired four years after the date of its previous election. The election Decree was required to be issued no later than the twenty-fifth day prior to the date of expiry of parliament and published on the following day in the Official Gazette of the Community of Madrid, with election day taking place between the fifty-fourth and the sixtieth day from publication and set so as to make them coincide with other concurrent elections when possible. The previous election was held on 8 May 1983, which meant that the legislature's term would have expired on 8 May 1987. The election Decree was required to be published no later than 14 April 1987, with the election taking place no later than the sixtieth day from publication, setting the latest possible election date for the Assembly on Saturday, 13 June 1987.

The Assembly of Madrid could not be dissolved before the date of expiry of parliament except in the event of an investiture process failing to elect a regional President within a two-month period from the first ballot. In such a case, the Assembly was to be automatically dissolved and a snap election called, with elected deputies merely serving out what remained of their four-year terms.

Opinion polls
The table below lists voting intention estimates in reverse chronological order, showing the most recent first and using the dates when the survey fieldwork was done, as opposed to the date of publication. Where the fieldwork dates are unknown, the date of publication is given instead. The highest percentage figure in each polling survey is displayed with its background shaded in the leading party's colour. If a tie ensues, this is applied to the figures with the highest percentages. The "Lead" column on the right shows the percentage-point difference between the parties with the highest percentages in a poll. When available, seat projections determined by the polling organisations are displayed below (or in place of) the percentages in a smaller font; 49 seats were required for an absolute majority in the Assembly of Madrid.

Elected legislators
The following table lists the elected legislators sorted by order of election.

Government formation
Investiture processes to elect the President of the Community of Madrid required for an absolute majority—more than half the votes cast—to be obtained in the first ballot. If unsuccessful, a new ballot would be held 48 hours later requiring of a simple majority—more affirmative than negative votes—to succeed. If none of such majorities were achieved, successive candidate proposals could be processed under the same procedure. In the event of the investiture process failing to elect a regional President within a two-month period from the first ballot, the Assembly would be automatically dissolved and a snap election called.