Semiconductor photocatalysis technology has a wide range of application in the treatment of environmental pollution. In this study, the Z-scheme heterojunction photocatalyst ZIF-8/Bi4O5Br2 was synthesized by hydrothermal method. The morphology, structure, mechanism and photocatalytic performance of the materials were studied. Under simulated sunlight illumination for 60 minutes, the degradation efficiency of oxytetracycline (15 mg·L−1) reached 94.2 %. In light of density functional theory calculation and liquid chromatography-mass spectrometry, the attack sites and degradation pathways of OTC were determined. The consequence of free radical capture test and electron paramagnetic resonance detection showed that ·O2-, ·OH and h+ were the primary active substances. Based on the analysis above, the charge transfer principle of Z-scheme heterojunction was further elucidation. It inhibited the recombination of photo carriers and improved the photocatalytic performance. This work provides a hopeful measure for photocatalytic degradation of OTC by Z-scheme heterojunction composite.