Magnetic nanoparticles of iron oxide (Fe3O4 NPs) were prepared using a biosynthetic method to investigate their potential use as an adsorbent for adsorption of Pb(II) and Cd(II) from the aqueous solution. The present study for the first time used the magnetite nanoparticles from leaf extract of Portulaca oleracea for the removal of Pb(II) and Cd(II) metal ions. Characterizations for the prepared Fe3O4 NPs (PO-Fe3O4MNPs) were achieved by using X-ray diffraction (XRD), field emission scanning electron microscope (FESEM), energy-dispersive X-ray spectroscopy (EDX), transmittance electron microscopy (TEM), and Fourier transform infrared (FTIR) spectroscopy. The batch adsorption process has been performed to study the effect of various parameters, such as contact time, pH, temperature, initial metal concentration, and adsorbent dose. The optimum pH for Cd(II) and Pb(II) adsorption was 6. The removal of heavy metals was found to increase with adsorbent dosage and contact time and reduced with increasing initial concentration. Langmuir, Freundlich, Khan, and Toth isotherms were used as adsorption isotherm models. The adsorption data fitted well with the Freundlich isotherm model with correlation coefficient (
R
2
>
0.94
). The maximum adsorption capacities (
Q
max
) at equilibrium were 177.48 mg/g and 108.2267 mg/g for Cd(II) and Pb(II), respectively. The kinetic analysis showed that the overall adsorption process was successfully fitted with the pseudo-second-order kinetic model. The calculated thermodynamic parameters (
∆
G
°
,
∆
H
°
, and
∆
S
°
) showed that the adsorption of Cd(II) and Pb(II) ions onto PO-Fe3O4MNPs was exothermic and spontaneous. These results demonstrate that biogenic synthesized PO-Fe3O4MNPs are highly efficient adsorbents for the removal of Pb(II) and Cd(II) ions from contaminated water.