In the present work, removing of COD from wastewater generated via Al-Diwanya petroleum refinery plant located in Iraq by adsorption with activated carbon (AC) derived from avocado seeds was successfully performed via a two-step approach. In the first step, AC was prepared from avocado seeds via impregnating with H3PO4 at 400 °C where effects of H3PO4 concentration and calcination time on the specific surface area of AC were studied. Additionally, properties of the prepared AC were examined by XRD, SEM, and FTIR to knowledge the features of the internal structure of AC. Results showed that the prepared AC has mesopores structure with pore diameters in the range between 30.07 and 50.8 µm. Increasing the weight percent of H3PO4 led to an increase in the specific surface area of AC to reach a maximum value beyond which a decrease in the specific surface area was happened with further increasing in H3PO4 percent. Increasing the time resulted in an increase in the AC specific surface area to reach a maximum value beyond which a decrease in specific surface area was happened. The best value of AC specific surface area was 436.6 m2/g which obtained at 70 %H3PO4 and 4 h. At the second step, the performance of the prepared AC in removing of COD by adsorption process was evaluated via studying the effects of three operating parameters, namely adsorbent dosage (1–5 g/L), pH (3–9), and shaking speed (100–400 rpm) on the removal of COD(RE%) using a response surface methodology (RSM). Increasing AC dosage led to an increase in RE% while increasing each of pH and shaking speed resulted in lowering RE%. The optimum conditions for higher RE% were AC dosage of 5 g/L, pH of 3, and shaking speed of 100 rpm in which a removal efficiency of 94.54 % was obtained. The degradation of COD with time was found to obey a second order kinetic confirming the chemisorption is the rate limiting step in the adsorption process.