This paper discusses the problem of the optimal determination of budget deficit limits in cases where the fiscal authority wishes to keep the budget deficit close to a reference value. It is assumed that the fiscal authority minimizes the expected discounted value of squared deviations from the reference value. Lump-sum and proportional intervention costs are considered. This paper is also an example of integration between stochastic process optimal control methods and the continuous time stochastic models. In fact, the characteristics of the stochastic process that rules the path of the budget deficit are taken from a previously developed continuous time stochastic model (Amador, 1999). Finally, simulation methods are used in order to conduct a comparative dynamics analysis. The paper concludes that, in the case of proportional intervention costs, the optimal ceiling depends positively on the cost parameter and on the variance of the budget deficit. On the contrary, the optimal ceiling depends negatively on the average budget deficit. These results remain valid in the case where there are both lump-sum and proportional intervention costs. Finally, in a stationary equilibrium context, we conclude that economies with higher tax rates and lower public expenditure should set higher budget deficit ceilings. The same is true for economies with a higher variance in technology and public expenditure shocks.