We propose a theory of domestic and foreign currency debt and limited commitment to exchange-rate and debt repayment policies. Exchange-rate depreciation is costly, but reduces the real value of domestic-currency debt and helps smooth consumption without the full punishment of default. However, during a global liquidity shock, government debt balances endogenously tilt towards hard-currency as in the data, although issuing local-currency debt to foreigners is needed the most to transfer the currency risk. This is because foreign lenders become more risk averse to holding nominal sovereign debt during stress episodes. We show that a modest depreciation of currency following adverse shocks precludes a sovereign default by inflating away outstanding local-currency debt burdens in contrast to a counterfactual economy with fully dollarized sovereign debt. The quantitative application of our theory accounts for the business cycle properties and the currency composition of sovereign debt in Mexico.