The aims of this study were to determine whether caffeine administration increased respiratory muscle function and if this was associated with lung function improvement in prematurely born infants being weaned from mechanical ventilation. Respiratory muscle function was assessed by measurement of the maximum pressures generated during occlusions at end inspiration (Pemax) and end expiration (Pimax) and lung function by measurement of lung volume (functional residual capacity (FRC)) and respiratory system compliance (CRS) and resistance (RRS) in 18 infants with a median gestational age of 28 (range 24-36) weeks. Measurements were made immediately prior to caffeine administration (baseline) and 6 h later. Six hours after caffeine administration compared to baseline, the median Pemax (p = 0.017), Pimax (p = 0.004), FRC (p < 0.001), CRS (p = 0.002) and RRS (p = 0.004) had significantly improved. Our results suggest that caffeine administration facilitates weaning of prematurely born infants from mechanical ventilation by improving respiratory muscle strength.