A solid phase extraction method based on graphene oxide (GO) modified with magnesium oxide (MgO) nanoparticles was developed for the preconcentration and determination of trace amounts of cadmium, copper and nickel ions. The adsorbed analytes were eluted by 4.0 mL of 0.1 M (EDTA) and injected to flame atomic absorption spectrometer. The factors influencing the complex formation and extraction of these heavy metals were optimized. Studies on potential interference by various anions and cations showed the method to be highly selective. The preconcentration factor was about 11 with relative standard deviation of <4.0 for 8 replication determination. The detection limits for the Cd, Cu, Ni were found to be 0.5, 3.4 and 25 μg L−1, respectively. The method was successfully applied for the determination of cadmium, copper and nickel in tap water, well water, sea water, rice and macaroni samples with spike recoveries ranging 93–105 %.