Water pollution, exacerbated by the improper disposal of non-biodegradable dyes from textile and paper industries, poses a significant global threat. Addressing this challenge, the present study focuses on the photocatalytic degradation of methylene blue (MB), a harmful azo dye, using novel Gd-doped CaO NPs synthesized with waste lemon peel extract (LPE) as a green stabilizing agent. The CaO NPs, calcined at 700 °C and subsequently doped with gadolinium (Gd) at concentrations of 2, 4, and 6 mmol via hydrothermal method, were characterized using various techniques. Fourier Transform Infrared Spectroscopy (FTIR) confirmed presence of Ca-O and Gd-O with the bond lengths of 1.7 Å and 1.2 Å, respectively. UV–Visible spectra revealed a bandgap in the range of 3.28 to 2.50 eV. X-ray Diffraction (XRD) patterns confirmed crystallinity with the crystallite size estimated using the Scherrer and William sons-Hall (W-H) methods ranging from 18 to 38 nm and XRD deduced specific surface area between 47 and 98 m2/g. Dynamic Light Scattering (DLS) showed particle size distribution from 38 to 130 nm, and zeta potential values ranging from −13.5 to −19.9 mV. The photocatalytic activity against MB was tested under UV light and natural sunlight at dye concentrations of 10, 15, and 20 ppm. The 4 mmol Gd-doped CaO NPs achieved a remarkable 98 % degradation efficiency within 2 h of sunlight exposure at a 10 ppm dye concentration. The degradation followed a pseudo-first-order reaction, and a possible degradation pathway was proposed for methylene blue. This study concludes that Gd-doped CaO NPs are highly effective, sustainable, and cost-efficient photocatalysts for wastewater treatment.