Sovereign debt crises are associated with severe output and consumption losses for the debtor country and with reductions in payments for the creditors. Moreover, such crises are accompanied by trade disruptions that lead to a sharp fall in the imports of intermediate inputs. Here I study the efficient risk-sharing arrangement between a sovereign borrower and foreign lenders in a production economy where the sovereign government cannot commit and has some private information. I show that the ex-ante efficient arrangement involves outcomes that resemble sovereign default episodes in the data. These outcomes are ex-post inefficient, in the sense that if the borrower and the lenders could renegotiate the terms of their agreement, committing not to do it again in the future, then both could be made better off. The resulting efficient allocations can be implemented with non-contingent defaultable bonds and active maturity management. Defaults and periods of temporary exclusion from international credit markets happen along the equilibrium path and are essential to supporting the efficient allocation. Furthermore, as in the data, interest rate spreads increase and the maturity composition of debt shifts toward short-term debt as the indebtedness of the sovereign borrower increases.