In this paper we assess the impact of unexpected shocks to real interest rates and GDP on government budgets for nine European Union countries. Shocks are estimated as one-step- ahead forecast errors arising from a recursive bivariate VAR model. To assess the impact on the budgets we use available information on budgetary sensitivities with respect to the business cycle and estimate the sensitivities to changes in interest rates on the basis of the maturity structure of public debts. Our analysis is relevant, in particular, to define what safety margins are needed to avoid the deficit exceeding the 3 per cent Maastricht threshold. The approach followed in this paper differs in two respects from standard analyses aiming at defining budgetary positions that satisfy the Stability and Growth Pact. First, whereas the latter examine only fluctuations in economic activity, we also consider fluctuations in interest rates. Second, whereas standard analyses focus on deviations from trends and define margins for the medium-term cyclically adjusted balance, we examine unexpected shocks and define margins for nominal balances. The results point to significant differences in the required margins across countries, depending on the amplitude of past shocks, the magnitude of automatic stabilizers and the size and maturity structure of the debt. In the case of Italy, the country with the highest debt/GDP ratio and the largest fraction of short-term debt, the impact of unexpected shocks to interest rates may be quite substantial. However, when shocks to interest rates and GDP are considered jointly, other countries (Belgium and Finland) seem to require larger margins.