The solid phase extraction is used for detection and separation of solute substances in solutions with very low concentrations because of convenience and low cost. The purpose of this research is to use solid phase extraction method to detect and separate two beta-lactam antibiotics (i.e., imipenem cilastatin, and meropenem) from natural and artificial wastewater, compare the results, and optimize the separation operational conditions. The design of experiments was performed by Minitab17 software package to get the required number of tests, and optimum conditions. The extraction column C-8 was used for separation experiments. The effects of pH of samples, type and volume of eluting solvent, solution flow rate through the solid bed and type of washing solvent on separation and detection were investigated. The extracted samples were analyzed by high performance liquid chromatography equipped with UV-vis spectrophotometer at a flow rate of 8.0 ml per minute of mobile phase (sodium phosphate buffer / methanol), and a UV-vis detector wavelength of 300 nm. The optimum operational conditions were: pH = 7, solution flow rate = 2 (ml /min), volume of eluting solvent = 8.5 ml, the best type of eluting solvent was methanol, and de-ionized water was determined as the best washing solvent. The extraction recovery for for imipenem cilastatin and meropenem was 97.8% and 68.1 %, respectively. The limit of detection (LOD) for imipenem cilastatin and meropenem was 2.1 µg/L, and 9.1 µg/L, respectively. The limit of quantification (LOQ) for imipenem cilastatin and meropenem was 3.8 µg/L and 6.3 µg/L, respectively. Keywords : Imipenem Cilastatin, Meropenem, Antibiotics, HPLC, Solid Phase Extraction