Editor’s Note: This paper is now published in the American Economic Review.
We study the relationship between domestic-demand shocks and exports using data for Spanish manufacturing firms in 2002–2013. Exploiting plausibly exogenous geographical variation caused by the Great Recession, we find that firms whose domestic sales declined by more experienced a larger increase in export flows, controlling for firms’ supply determinants. This result illustrates the capacity of export markets to counteract the negative impact of local demand shocks. By structurally estimating a heterogeneous-firm model of exporting with nonconstant marginal costs of production, we conclude that these firm-level responses accounted for half of the spectacular increase in Spanish goods exports over the period 2009–2013.