We analyze the effect of changes in fertility and longevity on taxes, the composition of government spending, and productivity. To that purpose, we introduce politics in an OLG economy with endogenous growth due to human and physical capital accumulation. Population ageing shifts political power from students and workers to retirees, leading to a reallocation of resources from education spending to retirement benefits and a slowdown of productivity growth. Calibrated to U.S. data, the closed-form solutions of the model predict retirement benefits as a share of GDP to strongly increase over the next decades and the education share to fall. This effect depresses the annual productivity growth rate by 10 basis points. In spite of higher labor-income taxes, per-capita labor supply is predicted to rise, as a consequence of increased life expectancy. The equilibrium allocation is consumption and production efficient, but the political process allocates a much smaller share of resources to eduction than a Ramsey planner with balanced welfare weights.