Magnetic biochar derived from agricultural biomass has been recognized as a cost-effective biochar sorbent for phosphate removal. This study evaluated the use of novel Fe/Mg-biochar nanocomposites (WBC1x), prepared by impregnating ground walnut shell in a solution with a different molar ratio of Fe2+ to Mg2+, then pyrolyzing slowly, at a temperature of 600 °C, to remove phosphate. The results showed that MgO and Fe3O4 were loaded onto the biochar successfully through the impregnation-pyrolysis method and the composites were able to be separated easily by magnetic field. Meanwhile, a higher surface area and point of zero charge on WBC1x were observed compared to the non-magnetic biochar (WBC). Moreover, the isothermal adsorption and kinetics data further suggested the that phosphate adsorption onto WBC1x resulted from chemisorption. Additionally, the maximum phosphate adsorption capacity of WBC1x was 6.9 mg.g−1, obtained though the Langmuir–Freundlich model, which was threefold higher than WBC, where MgO addition could enhance the adsorption capacity of WBC1x markedly by improving the surface charge.