A method for the selective extraction of sulfamethoxazole (SMO) in milk based on molecularly imprinted polymer (MIP) monolith as the sorbent was developed. The linear ranges were 5–600?μg/L for SMO in milk. High recoveries of 93.6?~?101.7?% from milk were obtained with relative standard deviations less than 6.1?%.