In the fiscal theory of the price level, inflation and debt dynamics are determined jointly. We derive optimal monetary policy rules that can approximate the Ramsey outcome in this environment. When the government issues a portfolio of bonds of different maturities and buys it back every period the optimal interest rate response to inflation is a simple, transparent function of the average debt maturity. This policy exploits the maturity structure to minimize the intertemporal variability of inflation in response to fiscal shocks. We then turn to the more realistic scenario of a government that does not repurchase and reissue debt in every period. In the case where debt is only long term, the optimal policy equilibrium features oscillations in inflation and simple interest rate rules may lead to explosive inflation dynamics. Issuing both short and long bonds rules out oscillations and implies that simple inflation targeting rules can approximate the Ramsey outcome. Under no repurchases a flat maturity structure of debt is optimal to reduce inflation variability.