Stunting is a measure of overall nutritional status and is a major public health concern because of its association with child mortality and morbidity and later adult performance. This study examined the effects of pregnancy events, birth characteristics and infant risk exposure on stunting at age 2 years. The study, established in 1990 in Soweto, an urban South African township, included 1098 mother–infant pairs enroled in the Birth to Twenty Plus longitudinal birth cohort study. In total, 22% of children were stunted at age 2 years, with males at greater risk than females [24.8 v. 19.4%, odds ratio (OR)=1.38; 95% confidence interval (CI): 1.03, 1.83]. In unadjusted analysis, male sex, household socio-economic status (SES), overcrowding, maternal age, maternal education, single motherhood, ethnicity, birth weight, gestational age and duration of infant breastfeeding were all significantly associated with stunting. In multivariable analysis, higher birth weight was protective against stunting for both sexes. Higher maternal education was protective for females only (adjusted odds ratio (AOR)=0.35; 95% CI: 0.14, 0.87), whereas wealthier household SES protected males (AOR for richest SES group=0.39; 95% CI: 0.16, 0.92). In this and other similar settings, current stunting prevention efforts focussing on primarily providing targeted proximal interventions, such as food supplements, risk undermining the critical importance of addressing key distal determinants of stunting such as SES and maternal education.