Pulmonary function testing was performed just prior to extubation on 50 infants mechanically ventilated for treatment of respiratory distress syndrome. All infants were ready for extubation as defined by clinical criteria. Pulmonary mechanics and energetics were measured by a computerized technique that consists of a pneumotachometer to measure flow rates and an esophageal balloon and differential transducer to estimate transpulmonary pressure. Tidal volume, minute ventilation, dynamic lung compliance, pulmonary resistance, and resistive work of breathing were then calculated by high speed microcomputer processing. Successful extubation was defined as greater than 72 hours without respiratory decompensation requiring reinstitution of ventilatory support. Thirty-six (72%) infants were successfully extubated and 14 (28%) infants failed extubation. Infants in the success and failure groups were matched for birth weight, gestational age, age at study, weight at study, weight at study relative to birth weight, use of nasal continuous positive airway pressure (CPAP), and methylxanthines. No statistically significant differences in pulmonary mechanics were seen between the two groups. Data suggests that successful withdrawal of mechanical ventilation may be related to multiple factors such as central inspiratory drive, diaphragmatic endurance, and chest wall stability, in addition to improved lung mechanics. Pulmonary function testing criteria alone may not be useful in determining optimal timing of extubation in premature infants.