Electrochemical oxidation (EO) using boron-doped diamond (BDD) electrodes attracted increasing interests due to its high efficiency in mineralizing chlorinated organic pollutants in water. However, it produces hazardous disinfection by-products (DBPs) including chloramines, chlorate and perchlorate ions and discharges acidic streams. In this work, an attempt to neutralize the acidic effluent and reduce the production of DBPs was developed. To do that, the EO of 2-chloroaniline (2-CA) in single and divided electrochemical flow cells using BDD anode and stainless steel cathode was investigated. The results showed that complete degradation of 2-CA and high mineralization yields were achieved using single and divided compartment cells. The separation of anolyte and catholyte by anion exchange membrane (AEM) in divided electrochemical configuration enhanced the efficiency of the electrochemical treatment and reduced the energy consumption; while, higher concentrations of free chlorine, nitrate, chlorate, and perchlorate ions were generated in the anolyte. A post-treatment of the treated solution in the cathodic compartment at low current density was effective in reducing the amount of free chlorine and chlorate ions, transferring chloride and nitrate ions to the anodic compartment by electro-dialysis, and neutralizing the anolyte and catholyte. Divided electrochemical cell configuration has the potential to achieve more efficient treatment of 2-CA for the recovery of valuable by-products (which can be considered as a powerful synthetic tool, from an environmental point of view; to produce high-added value products).