Background Children living with HIV requiring second-line antiretroviral therapy (ART) have limited options, an unmet need considering children require life-long ART. Methods Children from Uganda, Zambia, Zimbabwe were randomised to one of four second-line anchor drugs: dolutegravir(DTG), ritonavir-boosted darunavir(DRV/r), atazanavir(ATV/r), or lopinavir(LPV/r) in the factorial CHAPAS-4 trial(ISRCTN22964075)(second randomisation to tenofovir alafenamide fumarate(TAF) or standard-of-care(SOC) backbone, reported elsewhere). Dosing followed WHO weight-bands. The primary endpoint was viral load(VL) <400copies/mL at week-96, analysed using logistic regression, hypothesising that DTG and DRV/r would be superior (threshold p=0.03) to LPV/r and ATV/r arms combined and ATV/r would be non-inferior to LPV/r (12% margin). Secondary endpoints included immunology and safety. Analyses were intention-to-treat. Results 919 children, median(IQR) age 10(8-13) years, 54% male, baseline VL 17,573(5549,55700) copies/mL, CD4 669(413, 971) cells/mm3, weight-for-age Z-score -1.6(-2.4,-0.9), had spent median(IQR) 5.6(3.3,7.8) years on first-line ART. At week-96, DTG was superior (by 9.7%(95% CI 4.8%, 14.5%); p<0.0001) and DRV/r showed a trend to superiority (by 5.6%(0.3%, 11.0%); p=0.04) compared to LPV/r and ATV/r arms combined. ATV/r was non-inferior to LPV/r (+3.4%(-3.4%,+10.2%); p=0.33). CD4 counts increased with no differences between arms. Toxicity was lowest with DTG. All arms except LPV/r showed age-appropriate weight/height gains at week-96. DTG was not associated with excess absolute weight-gain (<1kg) vs. DRV/r or ATZ/r, irrespective of backbone randomisation. Conclusions DTG-based regimens are safe and cost-effective for second-line ART. DRV/r and ATV/r are also good options. Fixed-dose combinations of DTG, DRV/r or ATV/r with nucleoside/nucleotide-reverse-transcriptase-inhibitors (NRTIs) would increase access to robust, essential second-line options for children.