Using data from the last 150 years in a small set of countries, and from the postwar period in a large set of countries, we show that large investments in state primary education systems tend to occur when countries face military rivals or threats from their neighbors. By contrast, we find that...