An on-line, fast, simple, selective, and sensitive method has been developed for the determination of three herbicides belonging to the following families: triazines (atrazine), chloroacetamide (alachlor), and phenoxy (2,4-dichlorophenoxyacetic acid) in water samples. The method involves an in-syringe magnetic stirring-assisted dispersive liquid-liquid microextraction along with simultaneous silylation prior to their determination by gas chromatography with mass spectrometry. Extraction, derivatization, and preconcentration have been simultaneously performed using acetone as dispersive solvent, N-methyl-N-tert-butyldimethylsilyltrifluoroacetamide as derivatization agent and trichloroethylene as extraction solvent. After stirring for 180 s, the sedimented phase was transferred to a rotary micro-volume injection valve (3 mu L) and introduced by an air stream into gas chromatograph with mass spectrometry detector. Recovery and enrichment factors were 87.2-111.2% and 7.4-10.4, respectively. Relative standard deviations were in the ranges of 6.6-7.4 for intraday and 9.2-9.6 for interday precision. The detection limits were in the range of 0.045-0.03 mu g/L, and good linearity was observed up to 200 mu g/L, with R-2 ranging between 0.9905 and 0.9964. The developed method was satisfactorily applied to assess the occurrence of the studied herbicides in groundwater samples. The recovery test was also performed with values between 77 and 117%.