Objectives: The aim of the study was to determine the time to, and risk factors for, triple-class virological failure (TCVF) across age groups for children and adolescents with perinatally acquired HIV infection and older adolescents and adults with heterosexually acquired HIV infection. Methods: We analysed individual patient data from cohorts in the Collaboration of Observational HIV Epidemiological Research Europe (COHERE). A total of 5972 participants starting antiretroviral therapy (ART) from 1998, aged <20 years at the start of ART for those with perinatal infection and 15-29 years for those with heterosexual infection, with ART containing at least two nucleoside reverse transcriptase inhibitors (NRTIs) and a nonnucleoside reverse transcriptase inhibitor (NNRTI) or a boosted protease inhibitor (bPI), were followed from ART initiation until the most recent viral load (VL) measurement. Virological failure of a drug was defined as VL > 500 HIV-1 RNA copies/mL despite ≥ 4 months of use. TCVF was defined as cumulative failure of two NRTIs, an NNRTI and a bPI. Results: The median number of weeks between diagnosis and the start of ART was higher in participants with perinatal HIV infection compared with participants with heterosexually acquired HIV infection overall [17 (interquartile range (IQR) 4-111) vs. 8 (IQR 2-38) weeks, respectively], and highest in perinatally infected participants aged 10-14 years [49 (IQR 9-267) weeks]. The cumulative proportion with TCVF 5 years after starting ART was 9.6% [95% confidence interval (CI) 7.0-12.3%] in participants with perinatally acquired infection and 4.7% (95% CI 3.9-5.5%) in participants with heterosexually acquired infection, and highest in perinatally infected participants aged 10-14 years when starting ART (27.7%; 95% CI 13.2-42.1%). Across all participants, significant predictors of TCVF were those with perinatal HIV aged 10-14 years, African origin, pre-ART AIDS, NNRTI-based initial regimens, higher pre-ART viral load and lower pre-ART CD4. Conclusions: The results suggest a beneficial effect of starting ART before adolescence, and starting young people on boosted PIs, to maximize treatment response during this transitional stage of development. © 2016 British HIV Association.