In the U.S., state politicians directly influence legislation and budget decisions that can substantially affect public education spending and students. Does the political party of elected officials matter for these outcomes? We use a regression discontinuity design to analyze close house and gubernatorial elections from 1982 to 2016 and find that the impact of Democratic control of state government depends on whether elections occur during a presidential election year. On average, Democratic states spend less per capita on K-12 education. This trend, however, reverses when Democrats secure marginal control during off-cycle elections. Outside of presidential election years, we find increased state expenditures on both K-12 education and higher education. These increases coincided with smaller K-12 class sizes, relatively higher high school diploma rates, and expanded college enrollment. Our results highlight the importance of considering how federal political contexts influence the effects of state-level politics on education finance and outcomes.