Reactive oxygen species (ROS) produced in the specific tumor site plays the key role in photodynamic therapy (PDT). Herein, a multifunctional nanoplatform is designed by absorbing ultrasmall upconversion nanoparticles (UCNPs) on mesoporous graphitic-phase carbon nitride (g-C3 N4 ) coated superparamagnetic iron oxide nanospheres, then further modified with polyethylene glycol (PEG)molecules (abbreviated as Fe3 O4 @g-C3 N4 -UCNPs-PEG). The inert g-C3 N4 layer between Fe3 O4 core and outer UCNPs can substantially depress the quenching effect of Fe3 O4 on the upconversion emission. Upon near-infrared (NIR) laser irradiation, the UCNPs convert the energy to the photosensitizer (g-C3 N4 layer) through fluorescence resonance energy transfer process, thus producing a vast amount of ROS. In vitro experiment exhibits an obvious NIR-triggered cell inhibition due to the cellular uptake of nanoparticles and the effective PDT efficacy. Notably, this platform is responsive to magnetic field, which enables targeted delivery under the guidance of an external magnetic field and supervises the therapeutic effect by T1 /T2 -weighted dual-modal magnetic resonance imaging. Moreover, in vivo therapeutic effect reveals that the magnetism guided accumulation of Fe3 O4 @g-C3 N4 -UCNPs-PEG can almost trigger a complete tumor inhibition without any perceived side effects. The experiments emphasize that the excellent prospect of Fe3 O4 @g-C3 N4 -UCNPs-PEG as a magnetic targeted platform for PDT application.