Reintubation, which occurs in 6 to 23% within 48 to 72 hours after planned extubation, is a relevant consequence of respiratory failure after extubation. Patients with chronic respiratory disorders and invasively mechanically ventilated in intensive care unit, often exhibit hypercapnia, during breathing trial prior extubation. This is associated to increased incidence of extubation failure and mortality. Although the need for reintubation may be a marker of increased severity of illness, this is an independent risk factor for nosocomial pneumonia, increased hospital stay and mortality. NIV does not seem to be beneficial in avoiding reintubation when these patients have developed respiratory failure. However, a recent randomised study demonstrated that the early use of NIV averted respiratory failure after extubation in patients at increased risk. The patients were considered at risk if they had at least one of the following criteria: age > 65 years, cardiac failure, increased severity assessed by an Acute Physiologic and Chronic Health Evaluation score > 12. But, the beneficial effects of NIV on survival appear to be restricted to patients with chronic respiratory disorders and hypercapnia during the spontaneous breathing trial. So the beneficial effects of NIV should be confirmed in a trial in this specific population. We planned to conduct a study evaluating the efficacy of NIV in the prevention of extubation failure and mortality in these patients. If no signs of respiratory failure appeared after 120 min of a spontaneous breathing trial, patients will be extubated and randomly allocated after extubation to NIV group or control group. The clinical follow-up will be as follow: the incidence of extubation failure, the reintubation, the ICU and hospital mortality, 28-day survival, the complications associated to mechanical ventilation, ICU and hospital length of stay.