a regional president within a two-month period from the first ballot, the Assembly was to be automatically dissolved and a fresh election called. Any snap election held as a result of these circumstances would not alter the period to the next ordinary election, with elected deputies merely serving out what remained of their four-year terms. Background The 1987 election had resulted in a parliamentary deadlock. The opposition bloc of the People's Alliance (AP) and the CDS held 49 seats against 47 for the PSOE and IU. The ruling PSOE was initially able to hold on to power and have Joaquín Leguina re-elected President thanks to CDS' abstention, but nonetheless the government's majority remained precarious. In 1988, an AP deputy, Nicolás Piñeiro Cuesta, resigned from the party as a result of ideological differences with the Madrid AP leader, Alberto Ruiz-Gallardón. Piñeiro launched his own party, the Independent Madrilenian Regional Party (PRIM), shortly after. Thereafter, in January 1989, AP along with other parties merged into the newly-created People's Party (PP). In the first half of 1989, the PP and the CDS reached an agreement of cooperation in the Madrid Assembly, resulting in a motion of no confidence against Leguina's government in June 1989, in an attempt to replace it with a PP-CDS administration headed by Ruiz-Gallardón as Madrid President. To succeed, the motion needed the support of a majority of members, meaning that 49 votes were needed. With the PP and CDS having 48 members, Piñeiro's support was necessary. However, he abstained, and the United Left members blocked the motion alongside PSOE, resulting in the vote failing. Parties and candidates The electoral law allowed for parties and federations registered in the interior ministry, coalitions and groupings of electors to present lists of candidates. Parties and federations intending to form a coalition ahead of an election were required to inform the relevant Electoral Commission within ten days of the election call, whereas groupings of electors needed to secure the signature of at least 0.5 percent of the electorate in the Community of Madrid, disallowing electors from signing for more than one list of candidates. Below is a list of the main parties and electoral alliances which contested the election: 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