What makes countries engage in reforms of mass education? Motivated by historical evidence on the relation between military threats and expansions of primary education, we assemble a panel dataset from the last 150 years in European countries and from the postwar period in a large set of countries. We uncover three stylized facts: (i) investments in education are associated with military threats, (ii) democratic institutions are negatively correlated with education investments, and (iii) education investments respond more strongly to military threats in democracies. These patterns continue to hold when we exploit rivalries in a country’s neighborhood as an alternative source of variation. We develop a theoretical model that rationalizes the...