While Spain had traditionally under-performed its European counterparts in terms of labor productivity, the trend is reversed after 2007. The evolution of aggregate productivity in Spain during the Great Recession largely responds to the adverse conditions in the labor market, but not only. Using a longitudinal sample of Spanish manufacturing and services companies between 1995 and 2012, we show that the recent increase in Spanish aggregate productivity also responds to the evolution of the total factor productivity (TFP) and to composition effects. By combining the information at the firm level on balance sheet items, collective agreements and imports-exports, we are able to establish that commitment to a collective agreement at the firm level and access to external markets are positively related to TFP performance during the whole period. In addition, we estimate that firm TFP was negatively correlated with the share of temporary workers during the expansion period, 1995-2007, whereas the sign of that correlation reversed completely during the crisis, 2008-2012. Finally, we relate this sign reversal with the changing composition of temporary workers in the labor market.