This study integrates electrochemical pretreatment with microalgae (Scenedesmus obliquus) treatment to enhance nitrogen and phosphorus removal and resource recovery from swine wastewater. By optimizing electrochemical and microalgae treatment conditions, the dilution factor and the hydraulic retention time for microalgae treatment were reduced to 5 times and 7 days, respectively. Under the optimized operational conditions, removal efficiencies of total nitrogen and ammonia could reach over 89 %and 96 %,respectively, and the removal efficiency of total phosphorus was over 99 %. The study also found that aluminum was more suitable than iron for anode as it produced fewer residues. Additionally, the electrochemical pretreatment reduced Cu