Composting process of municipal solid waste is associated with the formation of a large volume of leachate containing hazardous and bio-refractory organic compounds and toxic heavy metals. This signifies the necessity for treating composting leachates. This study investigates the effectiveness of the electro-Fenton (E-Fenton) process for the treatment of a real composting leachate. The effects of various experimental parameters including reaction time, electrical current density, pH, hydrogen peroxide (H2O2) concentration, and the distance between the electrodes on the reduction in chemical oxygen demand (COD) were examined. The E-Fenton process was optimized based on the D-optimal algorithm using response surface methodology. Under optimized treatment conditions (reaction time = 100 min, initial pH = 3.0, H2O2 concentration = 0.25 M, and electrical current = 3.0 A), 63.4% of COD, 78.7% of BOD, and 99.3% of PO4–P were reduced. During the treatment process, NO3–N concentration increased from 24.12 to 40.03 mg/L. The experiments showed that the distance between the electrodes in the studied range had no significant effects on the treatment efficiency. A reduction in the biodegradability index of BOD5/COD from 0.60 to 0.31 indicated that most of the organic matter in composting leachate were biodegradable and were oxidized by the E-Fenton process. Conducting a separate set of experiments using the standard Fenton process on the same leachate resulted in 68.4% COD removal, demonstrating that the E-Fenton method could be considered as a promising and inexpensive alternative for the conventional Fenton process to treat composting leachates.