We describe a novel magnetic metal-organic framework (MOF) prepared from dithizone-modified Fe3O4 nanoparticles and a copper-(benzene-1,3,5-tricarboxylate) MOF and its use in the preconcentration of Cd(II), Pb(II), Ni(II), and Zn(II) ions. The parameters affecting preconcentration were optimized by a Box-Behnken design through response surface methodology. Three variables (extraction time, amount of the magnetic sorbent, and pH value) were selected as the main factors affecting adsorption, while four variables (type, volume and concentration of the eluent; desorption time) were selected for desorption in the optimization study. Following preconcentration and elution, the ions were quantified by FAAS. The limits of detection are 0.12, 0.39, 0.98, and 1.2 ng mL−1 for Cd(II), Zn(II), Ni(II), and Pb(II) ions, respectively. The relative standard deviations were <4.5 % for five separate batch determinations of 50 ng mL−1 of Cd(II), Zn(II), Ni(II), and Pb(II) ions. The adsorption capacities (in mg g−1) of this new MOF are 188 for Cd(II), 104 for Pb(II), 98 Ni(II), and 206 for Zn(II). The magnetic MOF nanocomposite has a higher capacity than the Fe3O4/dithizone conjugate. This magnetic MOF nanocomposite was successfully applied to the rapid extraction of trace quantities of heavy metal ions in fish, sediment, soil, and water samples.