The relationship between teenage childbearing and school attainment is investigated using nationally representative longitudinal data drawn from South Africa's National Income Dynamics Study. The analysis focuses on the outcomes by 2010 of a panel of 673 young women who were aged 15-18 and childless in 2008. Controlling for other factors, girls who went on to give birth had twice the odds of dropping out of school by 2010 and nearly five times the odds of failing to matriculate. Few girls from households in the highest-income quintile gave birth. Girls who attended schools in higher-income areas and were behind at school were much more likely to give birth than those who were in the appropriate grade for their age or were in no-fee schools. New mothers were much more likely to have re-enrolled in school by 2010 if they were rural residents, they belonged to relatively well-off households, or their own mother had attended secondary school. These findings suggest that, in South Africa, interventions that address poor school attainment would also reduce teenage childbearing.