An optimized solid-phase extraction (SPE) and ultra-high performance liquid chromatography-electrospray tandem mass spectrometry (UPLC-MS/MS) method was developed for the effective analysis of 35 antibiotics including sulfonamides (SAs), quinolones (QLs), tetracyclines (TCs), macrolides (MALs), lincomycin (LIN), and chloramphenicol (CAP). The addition of 0.1 % formic acid to the mobile phase was favorable for the formation of [M + H](+) and the enhancement in the detection signals, but using ammonium formate decreased [M + H](+) with a corresponding reduction in the response of CAP. The optimal pH range for the SPE was 4.5 similar to aEuro parts per thousand 5.0 with 6 mL aqueous ammonia/methanol (5/95, v/v) as the optimized eluent. An internal standard (IS) was selected for each type of analytes based on similarities in classification and retention time. The detection was completed in less than 10 min and was excellent with method detection limits (MDL) of 0.29 similar to aEuro parts per thousand 4.03 ng/L. The recoveries of the antibiotics in samples from ultrapure water and groundwater were 67.13 similar to aEuro parts per thousand 93.00 % and 68.91 similar to aEuro parts per thousand 92.67 %, respectively. The antibiotics in samples collected from wastewater, surface water, and groundwater were also effectively detected. This newly developed method has the advantages of short detection times, small sample consumption, excellent reproducibility, and high sensitivity. This provides a reliable and promising technique for the simultaneous detection and monitoring of various residual antibiotics in aqueous environmental samples.