A nanocomposite prepared from graphene nanosheets and cerium nanoparticles (G/CeO2) was applied to the extraction of Se(IV), As(V), As(III), Cu(II) and Pb(II). The structure of G/CeO2 was investigated by scanning electron microscopy, X-ray diffraction and Raman spectroscopy. The optimal pH values for extraction are 4.0 for As(V), 3.0 for Se(IV), and 6.0 for both Cu(II) and Pb(II). The maximum adsorption capacity of G/CeO2 (expressed as mg·g−1) were calculated by the Langmuir model and are found to be 8.4 for As(V), 14.1 for Se(IV), 50.0 for Cu(II) and 75.6 for Pb(II). The sorbent was applied to dispersive solid phase microextraction prior to direct quantitation by energy-dispersive X-ray fluorescence spectrometry without the need for prior elution. The limits of detection (in ng·mL−1 units) are 0.10 for As(V), 0.11 for Se(IV), 0.19 for Cu(II) and 0.21 for Pb(II). The precisions (RSDs) are <4.5%. The accuracy of the method (1 - 4%) was verified by analysis of the certified reference material (CRM 1640a - natural water). The method was successfully applied in ultratrace element determination and to the speciation of selenium in environmental waters.Graphical abstractThe method gives possibility of simultaneous preconcentration and determination in environmental waters of both anionic (As(V) and Se(IV)) and cationic (Cu(II) and Pb(II)) forms of selected metals using graphene nanosheets and cerium nanoparticles. Se(IV) can be selective determined in the presence of Se(VI).