This paper reports the chemical synthesis of MgO and Er-doped MgO nanoparticles (NPs) by the sol-gel method. Their microstructural, optical characterization and the evaluation of their photocatalytic activity are presented. The synthesized NPs were characterized by means of Xray diffraction (XRD), Fourier Transform Infrared Spectroscopy (FTIR), Environmental Scanning Electron Microscopy (ESEM), Transmission Electron Microscopy (TEM), Energy Dispersive X-ray Spectroscopy (EDX), UV-visible and Photoluminescence (PL) spectroscopy. The effective synthesis of cubic MgO compound is attested by XRD, FTIR and electron diffraction in TEM. Er 2 O 3 cubic secondary phase is found in the 2 and 3 wt. % Erdoped MgO samples. The average size of the roundish cuboid-shaped crystallites decreases from 50 nm to 32 nm upon the incorporation of the rare earth element (TEM, XRD).Concomitantly, the size of flakes in which the NPs do agglomerate follows the same trend (ESEM). UV-Visible results show that the calculated band-gap energy of the NPs was in the 5.23 to 5.35 eV range. PL analysis showed that all samples have visible emissions owing to the formation of defects in the MgO band-gap. The photocatalytic activity against methylene blue dye was evaluated under UV light irradiation. The photocatalytic results showed an improvement in degradation efficiency with the addition of erbium in samples, with a maximal MB dye removal for the 3 wt. % Er-doped MgO sample after 90 min irradiation. The performance is ascribed to a higher separation of the photo-generated (electron-hole) and larger surface area.