This paper describes the application of poly (ethylene glycol dimethacrylate-N-methacryloyl-L-tryptophane methyl ester) [p(EGDMA-MATrp)] microspheres as an affinity sorbent for the SPE (solid phase extraction) cleanup of sulfamerazine (SMR) from food samples of animal origin before high performance liquid chromatography (HPLC) analysis. The microspheres were prepared by suspension polymerization of ethylene glycol dimethacrylate (EGDMA) and N-methacryloyl-L-tryptophane methyl ester (MATrp) as a crosslinker and a monomer, respectively. Various parameters affecting the SPE cleanup efficiency of the p(EGDMA-MATrp) microspheres (contact time, pH, initial SMR concentration, ionic strength etc.) were optimized. Under the optimized conditions, maximum adsorption capacity was found to be 8.55 +/- 0.44 mg/g sorbent at pH 5.0. 90% of the adsorbed SMR was desorbed by using ACN:MeOH (5:5) mixture as a desorption agent. Applicability of the microspheres for the SPE cleanup of SMR residues in the food samples such as egg and milk with HPLC was also determined. It was demonstrated that the prepared p(EGDMA-MATrp) microspheres could be repeatedly applied for SPE cleanup of sulfamerazine before chromatographic analysis. Also, the recoveries of SMR in milk and egg samples were reasonably satisfactory and in the range of 71 to 90%.