In this paper, a ruthenium/titanium dioxide (Ru/TiO2) composite photocatalyst was successfully prepared with the sol–gel method. The composite catalysts were characterised by UV–Vis diffuse reflectance spectroscopy, X-ray diffraction, scanning electron microscopy, X-ray photoelectron spectroscopy and transmission electron microscopy. After being immobilised, the photocatalyst showed good photocatalytic activity and removed the ammonia molecules in the ultraviolet visible light region. The experimental results of ammonia nitrogen removal showed that the Ru/TiO2 photocatalyst removes ammonia molecules with high efficiency under UV irradiation at a wavelength of 365 nm. Finally, through experimental analysis of NO2− and NO3− production in the process of photocatalytic oxidation, the mechanism of ammonia nitrogen removal and the reduction of nitrate nitrogen in the process of photocatalytic oxidation are proposed. Under high-intensity light, NH4+ can be effectively removed, while photogenerated electrons have a reduction effect on NO3− and the generation of NO3− can be controlled. [ABSTRACT FROM AUTHOR]