We study optimal fiscal policy in a monetary union where monetary policy is decided by an independent central bank. We consider a two-country model with trade in goods and assets, augmented with sticky prices, labor income taxes and stochastic government consumption. It is optimal to finance a shock in part by running deficits and in part by raising the labor income tax, even though the latter is distortionary. The optimal speed of adjustment of budget deficits is much higher than the benchmark adjustment of 0.5 percent of GDP per year required by the recent revision of the Stability and Growth Pact (SGP). Optimal fiscal policy does not depend on the initial level of public debt. Ramsey monetary policy allows for less aggressive and more expansionary response of fiscal policy than the monetary policy implied by an interest rates rule.