In this work, an ultraviolet light-driven YPrO3 photocatalyst was successfully synthesized via the sol-gel method, utilizing yttrium nitrate hexahydrate (Y(NO3)3·6H2O) and praseodymium nitrate hexahydrate (Pr(NO3)3·6H2O) as the yttrium and praseodymium sources, respectively, with oxalic acid dihydrate (H2C2O4·2H2O) serving as an auxiliary solvent. In addition, the prepared samples were characterized using X-ray diffraction (XRD), scanning electron microscopy (SEM), Fourier transform infrared spectroscopy (FT-IR), X-ray photoelectron spectroscopy(XPS), thermogravimetric and differential scanning calorimetry (TG-DSC), ultraviolet visible diffuse reflectance spectroscopy (UV VisDRS), and an electrochemical workstation. Also, the photocatalytic activity of YPrO3 samples was explored by using methyl orange (MO) solutionas a model pollutant to simulate wastewater under varying synthesis temperatures and illumination durations. The material with the highest degradation efficiency was subjected to cycling and recovery experiments to assess its stability. Furthermore, the photocatalytic mechanism of YPrO3 was investigated. Experimental results revealed that pure YPrO3 samples could be effectively synthesized at calcination temperatures ranging from 850 °C to 1000 °C, with the sample prepared at 900 °C exhibiting the optimal photocatalytic activity. This sample possessed an average grain size of 4–5 μm. Under UV light irradiation for 90min, the YPrO3 sampleprepared at 900°Cachieved approximately 80 % degradation of methyl orange at an initial concentration of 5 mg/L. After five consecutive cycles, the degradation rate remained as high as 70.39 %, with no change in the crystal structure, indicating excellent stability. The photocatalytic mechanism of YPrO3 was found to involve the synergetic effect of superoxide radicals and photogenerated holes in degrading pollutants. In conclusion, YPrO3could be a promising photocatalyst with excellent performance, holding broad application prospects.