Background: Respiratory syncytial virus (RSV) is a major cause of lower respiratory tract infection (LRTI) in children. Early-life RSV LRTI might affect long-term health but there are few data from low-income and middle-income countries. We investigated the epidemiology and effect of early-life RSV LRTI on lung health in a South African birth cohort. Methods: We conducted the Drakenstein Child Health Study (DCHS), an ongoing birth cohort longitudinal study in the Western Cape province, South Africa. We enrolled pregnant women aged 18 years or older during their second trimester of pregnancy at two public health clinics. We followed up study children from birth to 2 years. The primary outcome of the study was LRTI and RSV LRTI. LRTI and wheezing episodes were identified through active surveillance; respiratory samples were tested for RSV and other pathogens. Wheezing was longitudinally identified by caregiver report and ascertainment at health facilities. Lung function was measured from 6 weeks to 2 years. We analysed the associations between RSV LRTI and subsequent LRTI, wheezing, and lung function using generalised estimating equations and mixed-effects linear regression. Findings: We enrolled 1137 mothers between March 5, 2012, and March 31, 2015. Among their 1143 infants, accruing 2093 child-years of follow-up, there were 851 cases of LRTI (incidence 0·41 episodes per child-year, 95% CI 0·38–0·43). Admission to hospital owing to LRTI occurred in 169 (20%) cases (incidence 0·08 episodes per child-year, 0·07–0·09), with a case-fatality ratio of 0·5%. RSV was detected in 164 (21%) of 785 LRTI events with a specimen available for qPCR, an incidence of 0·08 episodes per child-year (0·07–0·09); highest at age 0–6 months (0·15 episodes per child-year, 0·12–0·19). Children with a first RSV LRTI were three times as likely to develop recurrent LRTI compared with those with non-RSV LRTI (0·32 [0·22–0·48] vs 0·10 [0·07– 0·16] episodes per child-year; p<0·0001), particularly following hospitalised RSV LRTI. RSV LRTI and hospitalisation for all-cause LRTI were independently associated with recurrent wheezing (adjusted incident rate ratio 1·41, 95% CI 1·25–1·59, for RSV LRTI and 1·48, 1·30–1·68, for hospitalisation). LRTI or recurrent LRTI was associated with impaired lung function, but a similar outcome was observed following RSV LRTI or non-RSV LRTI. All-cause LRTI was associated with an average 3% higher respiratory rate (95% CI 0·01–0·06; p=0·013) and lower compliance (–0·1, −0·18 to 0·02) at 2 years compared with no LRTI. Recurrent LRTI was associated with further increased respiratory rate (0·01, 0·001–0·02), resistance (0·77 hPa s L−1, 0·07–1·47), and lower compliance (–0·6 mL hPa−1, −0·09 to −0·02) with each additional event. Interpretation: RSV LRTI was common in young infants and associated with recurrent LRTI, particularly after hospitalised RSV. Hospitalisation for all-cause LRTI, especially for RSV-LRTI, was associated with recurrent wheezing. Impairments in lung function followed LRTI or recurrent episodes, but were not specific to RSV. New preventive strategies for RSV might have an effect on long-term lung health. Funding: Bill & Melinda Gates Foundation; South African Medical Research Council; National Research Foundation South Africa; National Institutes of Health, Human Heredity and Health in Africa; Wellcome Trust.