Core–shell magnetic Fe3O4@C nanoparticles functionalized with sulfonic and carboxylic acid groups were synthesized and employed to capture heavy metal ions in aqueous media. The Fe3O4 cores possess unique magnetic properties for adsorbent separation, and the –SO3H and –COOH groups attached to the surface of the carbon shells determine the efficiency of heavy metal ion removal. Batch adsorption experiments showed that Pb2+, Hg2+, and Cd2+ ions can be completely and quickly removed by the Fe3O4@C nanoparticles. The equilibrium was established within 5 min, and the maximum adsorption capacities of the Fe3O4@C nanoparticles toward Pb2+, Hg2+, and Cd2+ ions were 90.7, 83.1, and 39.7 mg/g, respectively. The removal efficiencies were 96.3, 98.1, and 93.8 % for Pb2+, Hg2+, and Cd2+ ions, respectively. This work provides a facile and general approach to synthesize magnetic functional nanocomposites for wastewater treatment.