Education has been hailed as a “social vaccine” against HIV infection; but there is little causal evidence to support this claim. A 1996 policy reform in Botswana changed the grade structure of secondary school and led to sharp increases in educational attainment among affected birth cohorts. We use this ‘natural experiment’ to identify the effect of secondary schooling on HIV infection risk, fertility, sexual behaviors, and labor market outcomes. Data were obtained from the 2004 and 2008 Botswana AIDS Impact Surveys, nationally-representative household surveys with HIV biomarker collection. Each additional year of secondary schooling induced by the policy change decreased the probability of HIV infection by 8.1 percentage points (se=3.1), relative to a baseline prevalence of 25.6%. Effects were particularly large among women, who also saw a 15.8% point (se=5.7) reduction in the probability of having ever given birth. Schooling had no effect on HIV knowledge; however it influenced norms and behaviors, increasing condom use, HIV testing, and reporting that it is acceptable for women to carry condoms. For women, education delayed sexual debut and increased labor force participation. For men, education increased number of partners, but also increased literacy, and discussion about HIV with others. Supply-side measures to expand access to education in developing countries may have large health benefits. Estimates of the returns to schooling that exclude these non-pecuniary benefits may be too low.