Room temperature ionic liquids are novel solvents with a rather specific blend of physical and solution properties that make them of interest for applications in separation science. In this study, a green, simple, and sensitive sample pretreatment procedure coupled with high-performance liquid chromatography (HPLC) was developed for the analysis of sulfadimidine (SM2) that exploits an aqueous two-phase system based on 1-butyl-3-methylimidazolium tetrafluoroborate ([Bmim]BF 4 ) and ammonium sulfate ((NH 4 ) 2 SO 4 ) using a liquid-liquid extraction technique in real environmental water samples. The influences of the concentration of (NH 4 ) 2 SO 4 , pH value, temperature, and concentration of SM2 on the extraction efficiency of SM2 were determined. Under optimal conditions, the extraction efficiencies of SM2 were over 93.7%. Calibration curves yielded good linearity (R 2 = 0.9998) over the range 3-240 ng mL -1 , and the limit of detection and limit of quantification for analytes were 0.9 ng mL -1 and 3 ng mL -1 , respectively. The proposed method was successfully applied to the quantification of SM2 in water samples and recoveries were in the range of 101.2-107%.