Domestic public debt issued by emerging markets has risen significantly relative to international debt in recent years. Some recent empirical evidence also suggests that sovereigns have defaulted differentially on debt held by domestic and external creditors. Standard models of sovereign debt, however, mainly focus on how the actions of foreign creditors influence default decisions of sovereigns. Contrasting this one-sided focus, this paper adds to a new theoretical literature that points at the possibility of default on domestic debt and the consequences of doing so. It presents a model of an emerging market economy in which the government can selectively default on its domestic or external debt obligations. The model shows that the differential ability of domestic and foreign creditors to punish the government creates a gap in the expected default costs to the sovereign, and hence a differential in its propensity to default on its domestic versus foreign debt. The extent to which the possibility of differential treatment of creditors affects the composition of debt is explored. It shows that a country characterized by volatile output, sovereign risk, and costly tax collection will want to borrow in domestic markets as well as in international capital markets. The optimal allocation of debt between domestic and foreign creditors can thus be viewed as the government's purchase of insurance against macroeconomic shocks that affect its budget.