A comprehensive analytical method has been developed and validated for the simultaneous determination of seventeen glucocorticoid residues in eggs and milk. The mass spectrometer parameters, the composition of the mobile phase and the sample preparation method were firstly optimized to obtain maximum sensitivity. The samples were deconjugated with beta-glucuronidase/arylsulfatase enzyme and concentrated using an Oasis HLB solid-phase extraction cartridge, followed by cleanup with a dual Sep-pak silica and aminopropyl cartridge. The analytes were quantified by ultra-performance liquid chromatography (using a C18 column)/electrospray ionization tandem mass spectrometry (UPLC/ESI-MS/MS) operating in the negative ion mode. The assay for the 17 glucocorticoids was linear over the range of 1-200 microg/L for milk and egg samples with a high correlation coefficient (>0.99). The limits of quantification (LOQs) for the target analytes were 0.04-1.27 microg/kg for the egg samples and 0.03-0.73 microg/kg for the milk samples. The average extraction recoveries of the glucocorticoids from eggs and milk at two concentration levels (spiked at 0.40 and 2.00 microg/kg) were 65.6-118.7% and 61.5-119.6%, respectively, with relative standard deviations between 1.8-17.0% and 2.4-18.4%, respectively. Because of its high sensitivity, good precision and specificity, the method was found to be suitable for trace analysis of synthetic and natural glucocorticoids in complex biosamples such as eggs and milk.