A Ag/TiO2 nanocomposite, in which silver nanoparticles are highly dispersed in the uniformly sized pores of a cubic mesoporous TiO2 molecular-sieve film, has been fabricated.