The authors show that the fungus Boletus edulis loaded with γ-FeO nanoparticles is a viable sorbent for magnetic solid phase extraction of trace levels of Co(II) and Sn(II). The surface structure of immobilized magnetized B. edulis was characterized by FT-IR, SEM and EDX. Experimental parameters were optimized. Following elution with 1 M HCl, the ions were quantified by ICP-OES. The limits of detection are 21 pg·mL for Co(II), and 19 pg·mL for Sn(II). The preconcentration factors are 100 for both ions. The sorption capacities of the sorbent are 35.8 mg·g for Co(II) and 29.6 mg·g for Sn(II). The method was applied to the analysis of certificated reference materials and gave ≥95% recoveries with low RSDs. It was also successfully applied to the quantification of Co(II) and Sn(II) in spiked environmental and food samples. Graphical abstract The fungus Boletus edulis loaded with γ-FeO nanoparticles is a viable biosorbent for magnetic solid phase extraction (MSPE) of trace levels of Co(II) and Sn(II). The surface structure of immobilized magnetized B. edulis was characterized by FT-IR, SEM and EDX. Experimental parameters were optimized.