We study how debt frictions and demand affect corporate investment using administrative data from a large temporary investment tax credit in Portugal. We obtain exogenous variation in demand for exporting firms from product-destination-level changes in foreign demand. We proxy debt frictions by an index of different debt-earnings ratios. We find that debt has a strong, non-linear effect on the likelihood that a firm invests in response to the tax credit. Firms in the lower two quartiles of our debt-earnings index have roughly equal predicted take-up probabilities. For firms in the third quartile predicted take-up drops by 50% while firms in the worst debt-earnings quartile have a predicted take-up rate close to zero. We show that the effect of demand is mediated by the size of a firm’s debt burden. While demand has a strong positive effect for the bottom debt quartiles, demand ceases to affect take-up in the highest debt quartile. These results highlight that the distribution of debt, rather than the absolute stock of debt, matters for understanding post-crisis investment dynamics.