The present research describes the successful preparation of melon peel biochar modified with CoFe2O4 (MPBC/CoFe2O4) followed by its usage as a new sorbent to separate, preconcentrate, and determine the toxic heavy metal ions by magnetic solid-phase extraction. The metal ion desorption was performed by 0.1 M HCl solution with a volume of 5.0 mL. Flame atomic absorption spectrometry (FAAS) was utilized for detection of the analyte levels. SEM-EDX, TEM, XRD, and FTIR techniques were carried out to illuminate the structure of MPBC/CoFe2O4. The fundamental variables affecting the adsorption and elution efficiencies of the analyte ions including solution pH, MPBC/CoFe2O4 amount, type and concentration of eluent, adsorption and desorption equilibrium time, and sample volume were optimized. The detection limits were calculated as 0.41, 1.82, and 3.16 mu g L-1 for Cu2+, Cd2+, and Pb2+ ions, respectively, with the relative standard deviation of lower than 4.2%. There were no substantial interference effects on the analyte ion recovery due to the presence of foreign ions at high levels. Five minutes of contact time was adequate to attain the adsorption equilibrium. The adsorption capacity of MPBC/CoFe2O4 was obtained as 106.4, 65.4, and 188.7 mg g(-1) for Cu2+, Cd2+, and Pb2+ ions, respectively, by utilizing Langmuir isotherm model. The pseudo-second order model is favorable to identify the adsorption kinetics. The method was validated by spike/recovery test, and then, it was successfully implemented to determine the aforementioned analyte levels in sea and stream water, pepper, black cabbage, eggplant, and tomato samples.