A fully automated on-line solid-phase extraction-liquid chromatography-tandem mass spectrometry (SPE-LC-MS/MS) method has been developed for the determination of 13 cytostatics and 4 metabolites in aqueous matrices, including groundwater, surface water, and raw and treated wastewater. On-line SPE is performed by loading 5 mL of water sample at pH 2 through a PLRP-s cartridge. MS/MS is performed with an electrospray (ESI) interface operating in the positive ion mode and registering two selected reaction monitoring (SRM) transitions per compound. Quantification is carried out by the isotope dilution method using 15 different isotope-labelled compounds, specific for the target analytes, as internal standards (IS). The main advantages of the method are high sensitivity, with limits of determination in groundwater, surface water, and raw and treated wastewater below 5 ng L(-1) for all compounds except for gemcitabine (6.9-9.3 ng L(-1)), temozolomide (26-50 ng L(-1)), imatinib (80-180 ng L(-1)) and etoposide (38-65 ng L(-1)), repeatability, with relative standard deviations (RSDs) in most cases below 15%, and selectivity and reliability of results. The method is also fairly simple and fast, with an analysis time per sample (excluding the manual steps, i.e., sample filtration, pH adjustment, and addition of IS) of 40 min. Application of the method to influent wastewater samples collected daily during eight consecutive days from a wastewater treatment plant (WWTP) from Catalonia showed the presence of methotrexate, ifosfamide, capecitabine, tamoxifen and 6(α)-hydroxypaclitaxel but at fairly low concentrations (up to 43 ng L(-1)).