In the aftermath of the terrorist bomb attacks in Madrid , which occurred just three days before the elections , the Spanish Socialist Workers ' Party won a surprising victory . Its leader , José Luis Rodríguez Zapatero , headed the prime ministership from 2004 to 2011 , winning a second term in 2008 . Under a policy of gender equality , his was the first Spanish Government to have the same number of male and female members in the Council of Ministers . During the first four years of his prime ministership the economy continued to expand rapidly , and the government ran budget surpluses . His government brought social liberal changes to Spain , promoting women 's rights , changing the abortion law , and legalizing same-sex marriage , and tried to make the State more secular . The economic crisis of 2008 took a heavy toll on Spain 's economy , which had been highly dependent on construction since the boom of the late 1990s and early 2000s . When the international financial crisis hit , the construction industry collapsed , along with property values and several banks and '' cajas '' ( savings banks ) were in need of rescuing or consolidation . Economic growth slowed sharply and unemployment soared to over 20 % , levels not seen since the late 1990s . In applying counter-cyclical policies during the beginning of the crisis , and the ensuing drop in State revenues , the government financing fell into deficit . During an 18-month period from 2010 to 2011 , the government adopted severe austerity measures , cutting spending and laying off workers
terrorist bomb attacks
2004 Madrid train bombings
Politics of Spain