In adults in whom weaning from invasive mechanical ventilation is difficult, noninvasive ventilation may facilitate early liberation, but there is uncertainty about its effectiveness in a general intensive care patient population. OBJECTIVE To investigate among patients with difficulty weaning the effects of protocolized weaning with early extubation to noninvasive ventilation on time to liberation from ventilation compared with protocolized invasive weaning. DESIGN, SETTING, AND PARTICIPANTS Randomized, allocation-concealed, open-label, multicenter clinical trial enrolling patients between March 2013 and October 2016 from 41 intensive care units in the UK National Health Service. Follow-up continued until April 2017. Adults who received invasive mechanical ventilation for more than 48 hours and in whom a spontaneous breathing trial failed were enrolled. INTERVENTIONS Patients were randomized to receive either protocolized weaning via early extubation to noninvasive ventilation (n = 182) or protocolized standard weaning (continued invasive ventilation until successful spontaneous breathing trial, followed by extubation) (n = 182). MAIN OUTCOMES AND MEASURES Primary outcome was time from randomization to successful liberation from all forms of mechanical ventilation among survivors, measured in days, with the minimal clinically important difference defined as 1 day. Secondary outcomes were duration of invasive and total ventilation (days), reintubation or tracheostomy rates, and survival. RESULTS Among 364 randomized patients (mean age, 63.1 [SD, 14.8] years; 50.5% male), 319 were evaluable for the primary effectiveness outcome (41 died before liberation, 2 withdrew, and 2 were discharged with ongoing ventilation). The median time to liberation was 4.3 days in the noninvasive group vs 4.5 days in the invasive group (adjusted hazard ratio, 1.1; 95% CI, 0.89-1.40). Competing risk analysis accounting for deaths had a similar result (adjusted hazard ratio, 1.1; 95% CI, 0.86-1.34). The noninvasive group received less invasive ventilation (median, 1 day vs 4 days; incidence rate ratio, 0.6; 95% CI, 0.47-0.87) and fewer total ventilator days (median, 3 days vs 4 days; incidence rate ratio, 0.8; 95% CI, 0.62-1.0). There was no significant difference in reintubation, tracheostomy rates, or survival. Adverse events occurred in 45 patients (24.7%) in the noninvasive group compared with 47 (25.8%) in the invasive group. CONCLUSIONS AND RELEVANCE Among patients requiring mechanical ventilation in whom a spontaneous breathing trial had failed, early extubation to noninvasive ventilation did not shorten time to liberation from any ventilation.