Developmental trajectories of childhood wheezing in low-income and middle-income countries (LMICs) have not been well described. We aimed to derive longitudinal wheeze phenotypes from birth to 5 years in a South African birth cohort and compare those with phenotypes derived from a UK cohort. We used data from the Drakenstein Child Health Study (DCHS), a longitudinal birth cohort study in a peri-urban area outside Cape Town, South Africa. Pregnant women (aged ≥18 years) were enrolled during their second trimester at two public health clinics. We followed up children from birth to 5 years to derive six multidimensional indicators of wheezing (including duration, temporal sequencing, persistence, and recurrence) and applied Partition Around Medoids clustering to derive wheeze phenotypes. We compared phenotypes with a UK cohort (the Avon Longitudinal Study of Parents and Children [ALSPAC]). We investigated associations of phenotypes with early-life exposures, including all-cause lower respiratory tract infection (LRTI) and virus-specific LRTI (respiratory syncytial virus, rhinovirus, adenovirus, influenza, and parainfluenza virus) up to age 5 years. We investigated the association of phenotypes with lung function at 6 weeks and 5 years. Between March 5, 2012, and March 31, 2015, we enrolled 1137 mothers and there were 1143 livebirths. Four wheeze phenotypes were identified among 950 children with complete data: never (480 children [50%]), early transient (215 children [23%]), late onset (104 children [11%]), and recurrent (151 children [16%]). Multivariate adjusted analysis indicated that LRTI and respiratory syncytial virus-LRTI, but not other respiratory viruses, were associated with increased risk of recurrent wheeze (odds ratio [OR] 2·79 [95% CI 2·05-3·81] for all LTRIs; OR 2·59 [1·30-5·15] for respiratory syncytial virus-LRTIs). Maternal smoking (1·88 [1·12-3·02]), higher socioeconomic status (2·46 [1·23-4·91]), intimate partner violence (2·01 [1·23-3·29]), and male sex (2·47 [1·50-4·04]) were also associated with recurrent wheeze. LRTI and respiratory syncytial virus-LRTI were also associated with early transient and late onset clusters. Wheezing illness architecture differed between DCHS and ALSPAC; children included in ALSPAC in the early transient cluster wheezed for a longer period before remission and late-onset wheezing started at an older age, and no persistent phenotype was identified in DCHS. At 5 years, airway resistance was higher in children with early or recurrent wheeze compared with children who had never wheezed. Airway resistance increased from 6 weeks to 5 years among children with recurrent wheeze. Effective strategies to reduce maternal smoking and psychosocial stressors and new preventive interventions for respiratory syncytial virus are urgently needed to optimise child health in LMICs. UK Medical Research Council; The Bill & Melinda Gates Foundation; National Institutes of Health Human Heredity and Health in Africa; South African Medical Research Council; Wellcome Trust.