The tolerance of antiretroviral drugs in infants must be carefully evaluated. In previous studies of children with HIV type 1 (HIV-1) less weight gain was observed in children given lopinavir-ritonavir-based combinations than those given nevirapine. We aimed to compare the effects of lopinavir-ritonavir and lamivudine on growth in HIV-exposed uninfected infants included in the ANRS 12174 trial. ANRS 12174 was a multicentre, randomised, controlled trial of infant prophylaxis to prevent HIV-1 transmission by breastfeeding done at four antenatal clinics in Burkina Faso, South Africa, Uganda, and Zambia. HIV-exposed uninfected infants born to asymptomatic mothers not eligible for antiretroviral therapy (CD4 count >350 cells per μL) were randomly assigned (1:1) to receive lopinavir-ritonavir or lamivudine 7 days after birth, with stratification by country. In a prespecified secondary analysis, we assessed the effect of lopinavir-ritonavir and lamivudine on the growth of these infants from day 7 until cessation of breastfeeding (maximum treatment time 12 months) in the modified intention-to-treat population, which included all children correctly enrolled with at least one follow-up anthropometric measurement. We compared the growth of infants, defined as children's WHO-defined length-for-age Z score (LAZ), weight-for-length Z score (WAZ), and weight-for-age Z score (WLZ). We used linear mixed effect and β spline-regression models to compare growth between the treatment groups. The trial is registered with ClinicalTrials.gov, number NCT00640263. 1273 HIV-exposed uninfected infants and their mothers were enrolled between Nov 16, 2009, and May 7, 2013, of whom 1266 (99%) infants were included in the modified intention-to-treat analysis (630 assigned to lopinavir-ritonavir, 636 assigned to lamivudine). Baseline characteristics of the infants and mothers were similar across the two treatment groups. No differences in least-squares (LS) mean LAZ were identified between the treatment groups at any timepoint. LS mean WLZ was significantly lower in the lopinavir-ritonavir group than the lamivudine group at 26 weeks (difference -0·22 [95% CI -0·34 to -0·09], p=0·0006) and 50 weeks (-0·25 [-0·47 to -0·04], p=0·02). LS mean WAZ was also significantly lower in the lopinavir-ritonavir group than the lamivudine group at 26 weeks (difference -0·18 [95% CI -0·30 to -0·05], p=0·01) and 50 weeks (-0·24 [-0·45 to -0·05], p=0·02). Linear mixed models showed that lopinavir-ritonavir was associated with decreases in WLZ and WAZ over time (p<0·0001 and p=0·002), whereas spline regression models indicated that these reductions occurred early and remained constant thereafter (p<0·0001 with a knot at 44 days for WLZ; p=0·02 with a knot at 118 days for WAZ). The difference in LS mean WLZ at 50 weeks between the treatment groups was higher among girls than boys (difference -0·29 [95% CI -0·58 to 0·01], p=0·05 for girls; -0·22 [-0·53 to 0·09], p=0·18 for boys). Less weight gain was observed in infants given lopinavir-ritonavir than those given lamivudine, which is indicative of a persistent effect that could have long-term deleterious effects. This finding merits attention considering the recommendations for early and lifelong treatment of infants with HIV. French National Agency for Research on AIDS and Viral Hepatitis, the Total Foundation, the European Developing Countries Clinical Trials Partnership, and the Research Council of Norway.