We study the impact of bank credit supply on firm output and productivity. By exploiting a matched firm-bank database which covers all the credit relationships of Italian corporations over more than a decade, we measure idiosyncratic supply-side shocks to firms' credit availability. We use our data to estimate a production model augmented with financial frictions and show that an expansion in credit supply leads firms to increase both their inputs and their output (value added and revenues) for a given level of inputs. Our estimates imply that a credit crunch will be followed by a productivity slowdown, as experienced by most OECD countries after the Great Recession. Quantitatively, the credit contraction between 2007 and 2009 could account for about a quarter of the observed decline in Italy's total factor productivity growth. The results are robust to an alternative measurement of credit supply shocks that uses the 2007-08 interbank market freeze as a natural experiment to control for assortative matching between borrowers and lenders. Finally, we investigate possible channels: access to credit fosters IT-adoption, innovation, exporting, and the adoption of superior management practices.