The aim of this study was to determine the relative effects of theophylline and caffeine on neonatal respiratory function. Fifty-three preterm infants (45 infants with a median gestational age of 28 weeks, range 24-34 weeks completed the protocol) were randomized to receive either theophylline (loading dose 4 mg/kg followed by 4 mg/kg/day) or caffeine (loading dose 10 mg/kg followed by 5 mg/kg/day). Compliance of the respiratory system (CRS), strength of Hering Breuer reflex and the inspired oxygen concentration requirement were measured immediately prior to, 24 h and 7 days after commencing therapy. There was no statistically significant difference in the patient characteristics of the two groups, but only the theophylline group contained immature infants (i.e. < 26 weeks gestational age (n = 7)). At 24 h, there was a significant improvement in CRS and reduction in supplementary oxygen requirements in the caffeine group (p < 0.01), in the theophylline group no such significant effects were seen. In the study population overall, after 7 days of treatment in both the theophylline and caffeine groups there was an improvement in CRS (p < 0.05 and p < 0.01 respectively) and a reduction in the inspired oxygen concentration (p < 0.05 and p < 0.01 respectively). There was, however, a significant reduction in the strength of the Hering Breuer reflex only in the caffeine group (p < 0.05) and this was a decrease which related to the change in CRS (p < 0.05). The only statistically significant difference in the magnitude of change in CRS, reflex strength or supplementary oxygen requirements between the two groups was that the reduction in inspired oxygen requirement in the caffeine group was greater than that in the theophylline treated infants at 24 h (p < 0.05). We conclude theophylline and caffeine have similar effects on neonatal respiratory function, but our results suggest caffeine administration may be associated with an earlier onset of action.