Background: Cerliponase alfa is a recombinant human tripeptidyl peptidase 1 (TPP1) enzyme replacement therapy for the treatment of neuronal ceroid lipofuscinosis type 2 (CLN2 disease), which is caused by mutations in the TPP1 gene. We aimed to determine the long-term safety and efficacy of intracerebroventricular cerliponase alfa in children with CLN2 disease. Methods: This analysis includes cumulative data from a primary 48-week, single-arm, open-label, multicentre, dose-escalation study (NCT01907087) and the 240-week open-label extension with 6-month safety follow-up, conducted at five hospitals in Germany, Italy, the UK, and the USA. Children aged 3–16 years with CLN2 disease confirmed by genetic analysis and enzyme testing were eligible for inclusion. Treatment was intracerebroventricular infusion of 300 mg cerliponase alfa every 2 weeks. Historical controls with untreated CLN2 disease in the DEM-CHILD database were used as a comparator group. The primary efficacy outcome was time to an unreversed 2-point decline or score of 0 in the combined motor and language domains of the CLN2 Clinical Rating Scale. This extension study is registered with ClinicalTrials.gov, NCT02485899, and is complete. Findings: Between Sept 13, 2013, and Dec 22, 2014, 24 participants were enrolled in the primary study (15 female and 9 male). Of those, 23 participants were enrolled in the extension study, conducted between Feb 2, 2015, and Dec 10, 2020, and received 300 mg cerliponase alfa for a mean of 272·1 (range 162·1–300·1) weeks. 17 participants completed the extension and six discontinued prematurely. Treated patients were significantly less likely than historical untreated controls to have an unreversed 2-point decline or score of 0 in the combined motor and language domains (hazard ratio 0·14, 95% CI 0·06 to 0·33; p<0·0001). All participants experienced at least one adverse event and 21 (88%) experienced a serious adverse event; nine participants experienced intracerebroventricular device-related infections, with nine events in six participants resulting in device replacement. There were no study discontinuations because of an adverse event and no deaths. Interpretation: Cerliponase alfa over a mean treatment period of more than 5 years was seen to confer a clinically meaningful slowing of decline of motor and language function in children with CLN2 disease. Although our study does not have a contemporaneous control group, the results provide crucial insights into the effects of long-term treatment. Funding: BioMarin Pharmaceutical