A biocompatible magnetic material containing an iron oxide nanoparticle andone ormore biocompatible polymers, each having formula (I) below, covalently bondedto the ironoxide nanoparticle:(see formula I)in which each of variables R, L, x, and y is defined herein, the biocompatiblemagnetic materialcontains 4-15% Fe(II) ions relative to the total iron ions. Also disclosed isa method of preparingthe biocompatible magnetic material.