Background Caffeine and theophylline are methylxanthine compounds that have been widely used in the treatment of apnea of prematurity (AOP). Previous studies comparing the two agents have shown inconsistent results and have mostly used intravenous preparations. Objective To assess the effectiveness of oral administration of caffeine compared to oral theophylline as therapy for apnea of prematurity. Methods Fifty consecutively recruited premature neonates (gestational age 28-34 weeks, birth weight <2,500 g) with AOP who were able to tolerate at least 10 mL/kg of enteral feeding were randomized to receive either oral caffeine or oral theophylline for seven days. The main outcome was the daily frequency of apnea after treatment. Secondary outcomes were duration of oxygen or CPAP administration, duration of oxygen fraction (FiO2) taper to reach 21%, time to achievement of full feeding tolerance, length of hospital stay, and side effects. Results We randomized 25 subjects into each group. The distribution of baseline characteristics (gender, gestational age, mode of delivery, birth weight and length, age at onset of AOP, and initial frequency of AOP) was similar between both groups. The mean daily number of apnea episodes after treatment was significantly higher in the caffeine group compared to the theophylline group [3.16 (SD 1.31) vs. 2.28 (SD 1.40); P=0.031]. The caffeine group, compared to the theophylline group, also had a longer mean duration of oxygen or CPAP use [12.56 (SD 7.67) days vs. 8.40 (SD 6.41) days; P=0.030] and duration of FiO2 taper [5.76 (SD 2.68) vs. 4.08 (SD 2.54); P=0.035]. There were no significant differences in mean time to full feeding and mean length of hospital stay. There was no significant difference in the occurrence of side effects between the two groups. Conclusion In premature neonates with AOP, oral theophylline is slightly more effective than oral caffeine in reducing the frequency of apnea and is associated with a shorter duration of oxygen or CPAP use and duration to reach 21% FiO2.