In this study, an efficient biosorbent was developed from deoiled carob seeds, a agroindustrial waste. The biosorption efficiency was evaluated for cadmium and cobalt ions removal from aqueous solution under various parameters such as treating agent, solution pH, biosorbent dosage, contact time, initial metal ions concentration, and temperature. The effect of some major inorganic ions including Na+, K+, Ca2+, Mg2+, and Al3+on the biosorption was also established. Based on this preliminary study, four independent variables including solution pH, biosorbents dosage, initial metal concentration, and treating agent were chosen for the optimization of the process using full-factorial experimental design. It was found that chemical pretreatment of the raw deoiled carob seeds with NaOH strongly enhances its biosorption potential. Thus, the optimal conditions for high biosorption of cadmium(II) and cobalt(II) were achieved at pH of 6, biosorbent dosage of 1 g/L, and initial metal concentration of 50 mg/L. The biosorbents were characterized by Fourier transform infrared spectroscopy (FT-IR), scanning electron microscopy (SEM), energy dispersive X-ray (EDX), Boehm titration, and the point of zero charge (pHPZC).