The treatment of biomass waste has become a serious environmental issue recently. In this study, an innovative magnesium doped magnetic biochar composite (MMB) was successfully prepared using shaddock peels as precursor, and it was adopted to activate persulfate (PS) for levofloxacin (LFX) degradation. Results indicated that PS activation efficiencies were depended on the pyrolysis temperature. Defect structures, graphitization degree, and metal oxides amounts of MMB could all be significantly affected by pyrolysis temperature. MMB was highly effective in LFX removal compared with pristine biochar, 87.87% of LFX could be removed within 240 min under the optimum experimental condition. Quenching experiments and electron spin resonance (ESR) results demonstrated that both radical and non-radical pathways contributed to the degradation. Degradation pathways of LFX were proposed according to the results of LC-MS. The reusability of MMB could maintain stable after 3 cycles. Furthermore, the catalytic performance of MMB was also examined in the natural water. This study introduced a novel and promising methodology both for levofloxacin removal and for biomass waste utilization.