The premiership of Rodríguez Zapatero (2004–2011) mark the fourth period of the reign of King Juan Carlos I of Spain. The nearly eight years during which José Luis Rodríguez Zapatero governed Spain—marking the second socialist government in the monarchy, after the governments of Felipe González (1982–1996)—encompassed two very different legislative terms. "The first term was marked by major political debates on civil and social rights, the territorial model, negotiations with ETA, and historical memory, while the second term was dominated by the economic crisis, which wiped out all of the government's projects. Zapatero's actions were also very different in each case. In his first term, he took on enormous political risks, was bold and original in many of his initiatives, and as a result received overwhelming support among left-wing citizens in 2008. In his second term, Zapatero was behind the times...". Thus, according to political scientist Ignacio Sánchez-Cuenca, the first term (2004–2008) were "years of change" and the second (2008–2011) "years of crisis."

Return of the PSOE to power: "11-M" attacks and 2004 elections

On Thursday, March 11, 2004, three days before the general elections, ten bombs exploded in four commuter trains in Madrid, killing 191 people and injuring more than 1,500. It was the deadliest terrorist attack in Spanish and European history and caused political parties to suspend their election campaigns. ETA was initially thought to be responsible, a suspicion confirmed a few hours later by Interior Minister Ángel Acebes. However, the police investigation soon pointed to Islamist terrorism linked to al-Qaeda—responsible for the September 11 attacks—although the government maintained that the main hypothesis was still ETA. The confusion over the perpetrators of the attack was evident in the massive anti-terrorism demonstrations that took place the next day-the largest in Spain's history, with an estimated 11 million people taking to the streets on Friday, March 12-where some participants chanted "Who did it?" and "We want the truth," while others shouted "ETA murders." On Saturday, March 13, the day of reflection before the elections, thousands of demonstrators gathered in front of the Partido Popular headquarters in major cities, accusing the government of "hiding the truth" and demanding to "know the truth before voting," as well as chanting "No to the war." At 8 p.m., Minister Acebes announced the arrest of five Moroccans as suspects in the attacks. The theory that ETA was behind the attacks was definitively ruled out four hours later when the minister appeared again, this time to announce the discovery of a video claiming responsibility, in which a man speaking in Arabic with a Moroccan accent declared on behalf of al-Qaeda:What happened in Madrid... is a response to your collaboration with the criminals of Bush and his allies... [and] to the crimes you have caused in the world, especially in Iraq and Afghanistan, and there will be more, God willing.In Spanish: "Lo que ha ocurrido en Madrid... es una respuesta a vuestra colaboración con los criminales de Bush y sus aliados... [y] a los crímenes que habéis causado en el mundo y en concreto en Irak y en Afganistán y habrá más si Dios quiere".

The general elections took place on Sunday, March 14, 2004, and by 10 p.m., it was confirmed that the PSOE had won with 164 seats—12 short of an absolute majority—while the PP had 148. A month later, on April 16, the third transfer of power since the restoration of democracy in Spain took place: José Luis Rodríguez Zapatero was sworn in as the new prime minister, the fifth since 1977. In Congress, the deputies of his own party, the PSOE, voted for him, along with those of the Esquerra Republicana de Catalunya, Izquierda Unida-Iniciativa per Catalunya, Coalición Canaria, Bloque Nacionalista Galego and Chunta Aragonesista. CiU, PNV, EA and Nafarroa Bai abstained, while the PP voted against.

Period of change (2004–2008)

Change in foreign policy: Withdrawal from Iraq and return to the "old Europe"

The first decision of the new Socialist government led by José Luis Rodríguez Zapatero was to order the withdrawal of Spanish troops from Iraq, fulfilling his electoral promise. This decision significantly chilled relations with the United States, coming well before the promised June 30 deadline, and was followed by Rodríguez Zapatero's call for other countries with troops in Iraq to withdraw them as well.

The abandonment of the "Atlanticist" policy of the previous government led by Aznar was accompanied by a closer relationship with Germany and France, the two "old Europe" countries that had led the opposition to the invasion of Iraq, which in turn made it possible to unblock the negotiations on the new Treaty establishing a Constitution for Europe. This treaty had been opposed by Aznar and was signed in Rome on October 29, 2004. Zapatero quickly called for a referendum to ratify the treaty, which was held on February 20, 2005. It was approved by 75% of the voters, but the highest abstention rate in Spain's democratic history was recorded.

However, Rodríguez Zapatero became internationally isolated when the European constitutional project failed—plunging the European Union into the worst institutional crisis in its history—and especially when Germany and France reconciled with the United States after their main allies, German Chancellor Gerhard Schröder and French President Jacques Chirac, were replaced by Angela Merkel and Nicolas Sarkozy, respectively. Moreover, Zapatero's proposal for an Alliance of Civilizations, presented to the United Nations General Assembly in 2004 as an alternative to President Bush's war on terror, received little international support.

Opposition of the PP: "11-M" and "Strategy of Tension"

The Partido Popular (PP) blamed its electoral defeat on the "manipulation" of public opinion in the two days following the 11-M attacks by the PSOE and its allied media. In doing so, the PP implicitly questioned the legitimacy of the new government and demanded the creation of a parliamentary commission of inquiry to identify the perpetrators of the attack. The PSOE agreed, but expanded the scope of the committee to analyze the events from "11-M" to "14-M". During the committee's meetings, PP spokespersons, led by Eduardo Zaplana, supported the "11-M" version propagated by two media outlets: El Mundo newspaper and COPE radio network. According to this narrative, ETA and the secret services of Morocco and other countries, even Spanish police and agents allied with the PSOE, were involved, supposedly planting false leads in the investigation to blame Islamic terrorism and bring down the PP government.

In October 2007, the National Court ruled that the 11-M perpetrators were the radical Islamists who committed suicide in an apartment in Leganés a month after the attack, when the police had them completely surrounded.

"Extension of rights" and mobilization of the Catholic Church

The Rodríguez Zapatero government introduced a series of legal reforms in Parliament to extend the rights of citizens. Some of these reforms met with significant opposition from conservative sectors, particularly the law recognizing same-sex marriage, the so-called "express divorce" law (which accelerated divorce proceedings), the (which established guarantees to ensure the "parity" of women in public and professional life), and the Historical Memory Law (which recognized the victims of the defeated side in the Spanish Civil War, as the Franco dictatorship had already done for the victorious side).

The Spanish Catholic Church hierarchy, with the support of Pope John Paul II, who publicly criticized the Zapatero government for promoting secularism and religious indifference, played a prominent role in opposing these reforms. Various Catholic organizations, such as the , organized and led numerous massive demonstrations in "defense of the family" and "religious freedom," with the support of the Partido Popular.

The Catholic bishops—as well as the PP—strongly opposed the education reform proposed by the government, especially the introduction of the new Citizenship Education course in schools. They argued that it was an "attack on the morals" of Catholics and promoted a "radical secularism" that did not "respect the Constitution." The concessions made by the government, such as the modification of the course content and the generous agreement to fund the Catholic Church through income taxes, were not enough to quell the Catholic mobilization led by the bishops and driven by COPE Radio (owned by the Church).

Controversy over the New Statute of Autonomy of Catalonia

After months of intense debate, the Catalan Parliament approved the new Statute of Autonomy of Catalonia on September 30, 2005, with 120 votes in favor (from the PSC, ERC, ICV and CiU) and 15 votes against (from the PP). Article 1 of the statute declared that "Catalonia is a nation". It also proposed a new financing system similar to the economic agreements enjoyed by the Basque Country and Navarre, expanded the powers of the Generalitat, which were "shielded" so that the central government could not limit them through "fundamental laws," and proposed a "bilateral" relationship between Spain and Catalonia, implicitly recognizing the sovereignty of the "Catalan people." Criticism of the new Statute soon emerged, mainly from the PP and allied media, as it established a new "federal" or "confederal" model of the State that openly deviated from the 1978 Constitution.

The questionable constitutionality of the Catalan Statute proposal put Rodríguez Zapatero in a difficult position, as he had promised during the election campaign to support the project approved by the Catalan Parliament in the Madrid Cortes. Zapatero's difficulties became evident when voices within his own party, the PSOE, spoke out against the Statute, and criticism of the "Catalanism" and "sovereigntism" of Pasqual Maragall, the president of the Generalitat of Catalonia and the Statute's main proponent, intensified. Meanwhile, the PP, supported and encouraged by the conservative media, held events and demonstrations "in defense of Spain".

Thus began a tough debate in the Cortes Generales to remove the clearly unconstitutional elements from the Catalan Parliament's proposal. However, one of the partners of the tripartite Catalan government, the Esquerra Republicana de Catalunya (ERC), opposed the "cuts". As a result, Rodríguez Zapatero decided to negotiate directly with Artur Mas, a CiU leader and another supporter of the new statute. On January 22, 2006, they reached an agreement: the definition of Catalonia as a nation was relegated to the preamble of the Statute, and the "sovereignty" elements, including autonomous financing and the "bilateral" relationship between Spain and Catalonia, were modified.

The Esquerra Republicana de Catalunya (ERC) rejected the agreement between Zapatero and Mas, leading to the paradox that the ERC, one of the proponents of the Statute, called for a NO vote in the referendum held in Catalonia on June 18, 2006 to approve the new Statute. This led to the dissolution of the tripartite government and the calling of new elections for November 1, 2006. Pasqual Maragall, forced to resign by his party, did not run. The Socialist José Montilla would become the new president of the Generalitat of Catalonia, thanks to a new tripartite agreement, and ERC leader Josep Lluís Carod Rovira was appointed vice-president.

For its part, the Partido Popular, which had also campaigned for a NO vote in the referendum (albeit for reasons diametrically opposed to those of the ERC), filed an .

Shift in anti-terrorism policy: "Peace process"