Biodegradation of pharmaceuticals active compounds (PACs) in secondary effluents by using B. subtilis 2012WTNC as a function of β-lactamase was optimized using response surface methodology (RSM) designed by central composite design (CCD). Four factors including initial concentration of bacteria (1-6 log10 CFU mL-1), incubation period (1-14 days), incubation temperature (20-40 °C) and initial concentration of PACs (1-5 mg L-1) were investigated. The optimal operating factors for biodegradation process determined using response surface methodology (RSM) was recorded with 5.57 log10 CFU mL-1 of B. subtilis, for 10.38 days, at 36.62 °C and with 4.14 mg L-1 of (cephalexin/amoxicillin) with R2 coefficient of 0.99. The biodegradation was 83.81 and 93.94% respectively. The relationship among the independent variables was significant (p cephalexin against E. coli and S. aureus after degradation using B. subtilis which reflects the higher potential of bacteria to biodegrade PACs in secondary effluents. B. subtilis has the potential for biodegradation of PACs in the secondary effluents.