The interest in the removal of emerging contaminants has increased in the last decade. Photocatalytic degradation using p-n heterojunctions could effectively provide the degradation of these type of substances that are persistent in the environment. In this work, the synthesis, characterization, and photocatalytic evaluation of TiO2–F as well as CuO/TiO2–F and NiO/TiO2–F composite materials were studied in the photo-assisted degradation of caffeine using UV radiation. The fluorination of titanium dioxide induced changes in some physicochemical properties of the materials, which contributed to a decrease in surface area and bandgap energy as well as an increase in crystallite size as compared to pristine TiO2. ≡Ti–F species were evidenced to be formed, which could favor charge separation processes. A highest segregation of CuO species in comparison with NiO on the surface of TiO2–F could be formed, which could increase defect sites and decrease the band gap. The formation of a heterojunction between the semiconductors was evidenced, responsible for the observed improvements in photocatalytic properties of the composite materials. The photocatalytic tests evidenced an important degradation of caffeine; however, mineralization was incomplete. The stability of the composite materials and their potential use in the photocatalytic treatment of caffeine was evaluated by reuse tests. © 2021 The Authors