In order to testify the effect of electrolysis and microbial remediation technology in polluted river sediment. Here, we explored the possibility of electrochemically removing ammoniacal nitrogen-nitrogen (NH3-N), nitrate-nitrogen (NO3−-N) and phosphate ions-phosphorous (PO43−-P) by using a titanium (Ti) mesh cathode, a Ti/Ti dioxide (TiO2)/Ruthenium (IV) oxide (RuO2) (RuO2-IrO2/Ti) mesh, and a magnesium-aluminum (Mg–Al) alloy anode placed within the sediment and overlying water. Results showed that approximately 151.82 ± 21.69 mg TN was removed which was five times more effective than the non-electrolytic controls (30.21 ± 13.73 mg), NH3-N concentration in the sediment was substantially reduced (up to 2.9 times) compared to the non-electrolytic controls. Its efficiency lies in the electrolysis process, which may directly remove NH3-N through electrochemical oxidation and simultaneously produce oxygen which helps nitrifying bacteria to convert NH3-N into NO3−-N by the role of anode; and electrolysis may directly remove NO3−-N in the overlying water through electrochemical reduction while simultaneously producing hydrogen electron donor for hydrogen autotrophic microorganism as Hydrogenophohaga, to be the dominant species in sediment to enhance the removal of NO3−-N by the role of cathode. Electrolysis also reduced the PO43−-P through electro-coagulation since Mg2+ ions could also produce since sacrificial Mg–Al alloy anode was used and electro-deposition on Ti mesh cathode both to increase PO43−-P removal in overlying water and sediment. This study verifies the benefits of electrolysis-driven bioremediation as a sustainable technology for the bioremediation of N and P polluted river sediments.