This paper investigates the implications of the size of budget deficit in the open economy under perfect mobility of capital. For that purpose we construct a general equilibrium model with consumers maximizing the discounted utility of consumption, and firms maximizing profits. Government sets the size of the deficit relative to GDP and controls the structure of public debt. Using standard methods of optimal control theory we solve the model, i.e. we find explicit formulas for all trajectories and the level of welfare. Finally, we show that the higher the deficit-to-GDP ratio, the lower the welfare of consumers. Similarly, welfare increases with the share of foreign creditors in public debt.