Standard discussions of flexible inflation targeting as an optimal monetary policy abstract completely from the consequences of monetary policy for the government budget. But at least some of the countries now adopting inflation targeting have substantial difficulty in controlling fiscal imbalances, so that the additional strains resulting from strict control of inflation are of substantial concern, and some (notably Sims 2005) have argued that inflation targeting can even be counterproductive under some fiscal regimes. Here, therefore, we analyze welfare-maximizing monetary policy taking explicit account of the consequences of monetary policy for the government budget, and under a variety of assumptions about the nature of the fiscal regime. The paper contrasts the optimal monetary policies under three alternative assumptions about fiscal policy: (i) the case in which little distortion is required to raise additional government revenue, and the fiscal authority can be relied upon to ensure intertemporal government solvency [the implicit assumption in standard analyses]; (ii) the case in which only distorting sources of revenue exist, but distorting taxes are adjusted optimally; and (iii) the case in which tax rates cannot be expected to change in response to a change in monetary policy [the problematic case emphasized by Sims]. In both of cases (ii) and (iii), it is optimal for monetary policy to allow the inflation rate to respond to fiscal developments (and the optimal responses to other shocks are somewhat different than in the classic analysis, which assumes case (I)). Nonetheless, optimal monetary policy can still be implemented through a form of flexible inflation targeting, and it remains critical, even in the most pessimistic case (case (iii)), that inflation expectations (beyond some very short horizon) not be allowed to vary in response to shocks.