Caffeine is a naturally occurring alkaloid and it is metabolized to paraxanthine, theophylline and theobromine. Analysis of caffeine and its metabolites is challenging since the metabolites theophylline and paraxanthine generate similar product and precursor ions. In this study, a new method was developed for the simultaneous analysis of caffeine, paraxanthine, theobromine and theophylline in horse urine using gas chromatography-mass spectrometry (GC-MS). Urine samples were treated using solid-phase extraction followed by the elution with dichloromethane-isopropanol (90:10) after the pH was adjusted to 6, and then derivatization with N-methyl-N-trimethylsilyl-trifluoroacetamide-1% trimethylchlorosilane before analysis with GC-MS. Sample preparation and derivatization steps were optimized and the method permitted elution all of these analytes within 13 min. The method was fully validated according to Commission Decision, 2002/657/EC guidelines. The calibration curves were linear with a correlation coefficient of >0.99. Precision and accuracy were well within the 15% acceptance range and the method was robust. The validation results demonstrated that the method is highly reproducible, easily applicable and selective.The method was applied to urine samples collected from racehorses to demonstrate its applicability.