We use the August 2007 crisis episode to gauge the causal effect of financial contracting on real firm behavior. We identify heterogeneity in financial contracting at the onset of the crisis by exploiting ex-ante variation in long-term debt maturity structure. Using a difference-in-differences matching estimator approach, we find that firms whose long-term debt was largely maturing right after the third quarter of 2007 cut their investment-to-capital ratio by 2.5 percentage points more (on a quarterly basis) than otherwise similar firms whose debt was scheduled to mature after 2008. This drop in investment is statistically and economically significant, representing a drop of one-third of precrisis investment levels. A number of falsification and placebo tests suggest that our inferences are not confounded with other factors. For example, in the absence of a credit contraction, the maturity composition of long-term debt has no effect on investment. Moreover, long-term debt maturity composition had no impact on investment during the crisis for firms for which long-term debt was not a major source of funding. Our analysis highlights the importance of debt maturity for corporate financial policy. More than reporting evidence of a general association between credit markets and real activity, our analysis shows how the credit channel operates through a specific feature of financial contracting.