ObjectiveTo compare reintubation rates after planned extubation and unplanned extubation (UE) in patients in neonatal intensive care units (NICUs), to analyse risk factors for reintubation after UE and to compare outcomes in patients with and without UE.DesignProspective, observational study nested in a randomised controlled trial (SEPREVEN/Study on Epidemiology and PRevention of adverse EVEnts in Neonates). Outcomes were expected to be independent of the intervention tested.Setting12 NICUs in France with a 20-month follow-up, starting November 2015.Patientsn=2280 patients with a NICU stay >2 days, postmenstrual age ≤42 weeks on admission.Interventions/exposureCharacteristics of UE (context, timing, sedative administration in the preceding 6 hours, weaning from ventilation at time of UE) and patients.Main outcome measuresHealthcare professional-reported UE rates, reintubation/timing after extubation, duration of mechanical ventilation, mortality and bronchopulmonary dysplasia (BPD).ResultsThere were 162 episodes of UE (139 patients, median gestational age (IQR) 27.3 (25.6–31.7) weeks). Cumulative reintubation rates within 24 hours and 7 days of UE were, respectively, 50.0% and 57.5%, compared with 5.5% and 12.3% after a planned extubation. Independent risk factors for reintubation within 7 days included absence of weaning at the time of UE (HR, 95% CI) and sedatives in the preceding 6 hours (HR 1.93, 95% CI 1.04 to 3.60). Mortality at discharge did not differ between patients with planned extubation or UE. UE was associated with a higher risk of BPD.ConclusionIn the SEPREVEN trial, reintubation followed UE in 58% of the cases, compared with 12% after planned extubation.Trial registration numberNCT02598609.