Nanocrystalline porous N-doped ceria films have been prepared by combining sol-gel chemistry, evaporation-induced self-assembly (EISA), flash crystallization and treatment in NH 3 gas between 550 and 700 °C at flow rates of 270 and 670 cm 3 min -1. The maximum nitrogen uptake is 0.06 moles per Ce, observed for the sample treated at 600 °C and NH 3 flow rate of 670 cm 3 min -1. Nitrogen bonding to cerium is proved by XPS, through the observation of the characteristic Ce-N feature at ∼397 eV. Microstructural characterization shows that the mesostructure of the films is lost for treatment temperatures in ammonia higher than 550 °C but the porous fraction remains between 35 and 40% after ammonolysis for all the samples. The nitrided films show photocatalytic activity under visible light in the acetaldehyde decomposition, with the best results obtained for the films treated at 550 °C under NH 3 flow rate of 670 cm 3 min -1. © 2012 The Royal Society of Chemistry.