Measured total factor productivity (TFP) fell in Spain during the boom years of 1995–2007. Using administrative data from the quasi‐universe of firms, we show that there was an increase in misallocation, which was more severe in sectors where connections with public officials are more important for business success. We write and estimate a simple model of cronyism in which heterogeneous firms invest in political connections. Our quantitative exercise concludes that the institutional decline over this period costed 1.9% growth in TFP per year and a 0.8% annual increase in the resources spent by firms in establishing political connections.