Even in a trace amounts, the presence of antibiotics in aqueous solution is getting more and more attention. Accordingly, appropriate technologies are needed to efficiently remove these compounds from aqueous environments. In this study, we have examined the electrochemical oxidation (EO) of sulfamethoxazole (SMX) on a Co modified PbO 2 electrode. The process of EO of SMX in aqueous solution followed the pseudo-first-order kinetics, and the removal efficiency of SMX reached the maximum value of 95.1 % within 60 min. The effects of major factors on SMX oxidation kinetics were studied in detail by single-factor experiments, namely current density (1-20 mA cm-2), solution pH value (2-10), initial concentration of SMX (10-500 mg L-1) and concentration of electrolytes (0.05-0.4 mol L-1). An artificial neural network (ANN) model was used to simulate this EO process. Based on the obtained model, particle swarm optimization (PSO) was used to optimize the operating parameters. The maximum removal efficiency of SMX was obtained at the optimized conditions (e.g., current density of 12.37 mA cm-2 , initial pH value of 4.78, initial SMX concentration of 74.45 mg L-1 , electrolyte concentration of 0.24 mol L-1 and electrolysis time of 51.49 min). The validation results indicated that this method can ideally be used to optimize the related parameters and predict the anticipated results with acceptable accuracy.