A photoelectrochemical (PEC) aptasensor on basis of [Ru(bpy) 3 ] 2+ @Ce-UiO-66/Mn:Bi 2 S 3 composites was constructed for detecting ofloxacin (OFL). First, Ce-UiO-66, prepared by a solvothermal method, had Zr 4+ −Zr 3+ and Ce 4+ −Ce 3+ intervalence cycles to increase the charge separation efficiency. Subsequently, Ce-UiO-66 was further modified by [Ru(bpy) 3 ] 2+ and Mn:Bi 2 S 3 cosensitization to improve the photoelectric activity. [Ru(bpy) 3 ] 2+ not only broadened the range of light absorbed but also reacted with an electron donor to maintain the photoelectric conversion process. Among the [Ru(bpy) 3 ] 2+ @Ce-UiO-66/Mn:Bi 2 S 3 heterojunction, Mn:Bi 2 S 3 was a photosensitizer, which maximized the efficiency of the electron−hole separation and significantly improved photocurrent. Then, an aptamer was used as a biorecognition unit for OFL-specific detection. Under the best conditions, the PEC aptasensor realized the sensitive detection of OFL, with a detection range of 0.01−100 nmol/L and a detection limit of 6 pmol/L. In addition, the constructed PEC OFL sensor showed good reproducibility, stability, and specificity.