We develop a model with financial frictions and sovereign default risk wherein the maturity of public debt is allowed to be larger than one period. When the debt portfolio has longer average maturities, public debt increases less in the event of a crisis, reducing the size of the subsequent fiscal consolidation through distorsionary taxes or public spending, with positive effects on welfare. In addition, we provide some results suggesting that optimized fiscal responses to a crisis depend on the average maturity of the debt portfolio.