The CO2 response test measures the hypercapnic drive response (which is defined as the ratio of the change in airway-occlusion pressure 0.1 s after the start of inspiratory flow [ΔP(0.1)] to the change in P(aCO2) [ΔP(aCO2)]), and the hypercapnic ventilatory response (which is defined as the ratio of the change in minute volume to ΔP(aCO2)). In mechanically ventilated patients ready for a spontaneous breathing trial, to investigate the relationship between CO2 response and the duration of weaning. We conducted the CO2 response test and measured maximum inspiratory pressure (P(Imax)) and maximum expiratory pressure (P(Emax)) in 102 non-consecutive ventilated patients. We categorized the patients as either prolonged weaning (weaning duration > 7 d) or non-prolonged weaning (≤ 7 d). Twenty-seven patients had prolonged weaning. Between the prolonged and non-prolonged weaning groups we found differences in hypercapnic drive response (0.22 ± 0.16 cm H2O/mm Hg vs 0.47 ± 0.22 cm H2O/mm Hg, respectively, P < .001) and hypercapnic ventilatory response (0.25 ± 0.23 L/min/mm Hg vs 0.53 ± 0.33 L/min/mm Hg, respectively, P < .001). The optimal cutoff points to differentiate between prolonged and non-prolonged weaning were 0.19 cm H2O/mm Hg for hypercapnic drive response, and 0.15 L/min/mm Hg for hypercapnic ventilatory response. Assessed with the Cox proportional hazards model, both hypercapnic drive response and hypercapnic ventilatory response were independent variables associated with the duration of weaning. The hazard ratio of weaning success was 16.7 times higher if hypercapnic drive response was > 0.19 cm H2O/mm Hg, and 6.3 times higher if hypercapnic ventilatory response was > 0.15 L/min/mm Hg. Other variables (P(0.1), P(Imax), and P(Emax)) were not associated with the duration of the weaning. Decreased CO2 response, as measured by hypercapnic drive response and hypercapnic ventilatory response, are associated with prolonged weaning.