Zapatero was the son of a lawyer and the grandson of a Republican army officer executed by Gen. Francisco Franco’s forces during the Spanish Civil War. He attended the University of León and became a member of the university’s law faculty after graduating in 1982. In 1986 Zapatero, who had joined the Spanish Socialist Workers’ Party (Partido Socialista Obrero Español; PSOE) in 1979, was elected to the national parliament, becoming its youngest member. Two years later he was made general secretary of the PSOE’s León provincial federation. Zapatero established a reputation as a capable, hardworking deputy, but he held no public office in the socialist administrations that governed Spain between 1982 and 1996. In July 2000, however, he defeated three other candidates to become the party’s general secretary. He promised to modernize both the PSOE and its policies, offering an agenda that revolved around economic efficiency, women’s rights, democratic participation, laicism, and “constructive” opposition to the conservative Popular Party (PP) government.

As the 2004 general elections neared, opinion polls suggested an easy win for the PP. On March 11, 2004, however, Madrid suffered a series of terrorist attacks, and Prime Minister José María Aznar and his PP government drew criticism for their attempts to blame the Basque separatist group ETA even after members of the Islamist militant group al-Qaeda were arrested. Aided by the voter backlash, the PSOE won a surprise victory at the elections on March 14. Zapatero was sworn in as prime minister on April 17, 2004, and he subsequently appointed a cabinet that combined established and emerging figures, half of whom were women. Within weeks of taking office, he also followed through on a campaign pledge to withdraw troops serving in Iraq. (See Iraq War.) Zapatero’s government supported a number of social reforms, including the legalization of same-sex marriage and the criminalization of domestic violence. In response to two long-standing issues, the status of Catalonia and of the Basque Country, Zapatero supported the declaration of nationhood for Catalonia in 2006 and pledged not to yield to ETA terrorism, respectively.

The PSOE triumphed again in the 2008 general elections after a fiercely battled campaign, though it failed to gain an absolute majority. Zapatero pledged to boost Spain’s economy—which was slumping as a result of the economic downturn then afflicting much of the world—and to continue his agenda of social and political reform, but the country’s financial situation grew worse through 2009–10. Unemployment topped 20 percent, and plummeting poll numbers and PSOE losses in regional elections forced a series of cabinet reshuffles. Zapatero announced in April 2011 that he would not seek another term as prime minister, but that news failed to buoy the PSOE, which fared poorly in another round of regional elections held the following month. In July 2011, as Spain’s economy continued to flounder, Zapatero announced that he would advance the date of the next general election from March 2012 to November 2011. In the general election on November 20, 2011, the PP routed the PSOE, which turned in its worst performance since the post-Franco restoration of democracy. Zapatero remained prime minister of a caretaker administration, pending parliamentary approval of a new government.