An automated on-line solid-phase extraction-liquid chromatography-tandem mass spectrometry (SPE-LC-MS/MS) system was developed for the determination of macrolide antibiotics including erythromycin (ETM), roxithromycin (RTM), tylosin (TLS) and tilmicosin (TMC) in environmental water samples. A Capcell Pak MF Ph-1 column packed with restricted access material (RAM) was used as SPE column for the concentration of the analytes and clean-up of the sample. One milliliter water sample was injected into the conditioned SPE column and the matrix was washed out with 3 mL high purity water. By rotation of the switching valve, macrolides (MLs) were eluted in the back-flush mode and transferred to the analytical column by the chromatographic mobile phase. The matrix effect was evaluated by the directly injection LC-MS and on-line SPE-LC-MS methods. The limits of detection (LODs) and limits of quantification (LOQs) obtained are in the range of 2-6 and 7-20 ng L(-1), respectively, which means that the proposed method is suitable for trace analysis of MLs at low level concentration. The intra- and inter-day precisions are in the range of 2.9-7.2% and 3.3-8.9%, respectively. In the three fortified levels (20, 200 and 2000 ng L(-1)), recoveries of MLs ranging from 86.5% to 98.3% are obtained.