Cerium fluoride (CeF3) semiconductor with upconversion property was constructed on graphite carbonitride (g-C3N4) nanosheets by microwave hydrothermal method. The X-ray diffraction, transmission election microscopy, Fourier transform infrared, and X-ray photoelectron spectra techniques were used to characterize the CeF3/g-C3N4 nanocomposite. The study shows that CeF3 has upconversion property and can convert visible light (Vis) and near-infrared light (NIR) into ultraviolet light (UV). Moreover, CeF3 and g-C3N4 can form well-defined heterojunction and promote the effective separation of photogenerated electrons and holes. The synergistic effect of the CeF3/g-C3N4 nanocomposite was evaluated by photocatalytic degradation of dibenzothiophene (DBT). The optimum photocatalyst of CeF3/g-C3N4 (40 wt%) composites exhibit the highest photocatalytic desulfurization rate of the model oil under visible light radiation.