Here, we report the preparation of oxygen vacancy (OV)-rich ZnO and Co3O4 p-n heterojunction nanocomposites, i.e. ZOCO, by using ZnCl2 as Lewis acid to etch metal organic frameworks (ZIF-67) and subsequent pyrolysis in air, for the degradation of pefloxacin (PEF) antibiotic. Various characterization outcomes suggest the formation of OV-rich ZnO and Co3O4 p-n heterojunction in the ZOCO-2. The optimized ZOCO-2 has a higher charge transfer efficiency relative to the single metal oxide alone. The degradation rate of PEF in the ZOCO-2/PMS system was 94.81%, while only 44.18% by the simply mechanical mixture of two metal oxides. The degradation rate constant (kapp) of PEF in the ZOCO-2/PMS system was 1.35 min−1, which was much higher than the sum of the degradation rate constants of ZnO (0.0089 min−1) and Co3O4 (0.016 min−1). It indicates the important role of the heterojunction structure and Ov in ZOCO-2 in the degradation of PEF. Furthermore, the ZOCO-2/PMS system exhibited excellent stability and had low cobalt leaching. The ZOCO-2/PMS system showed good resistance to various inorganic anions and humic acid present in the environment. Reactive oxygen species studies suggested that the ZOCO-2/PMS system produced major 1O2 and SO4−, and minor OH and O2− during the degradation of PEF. The possible PMS activation mechanism by ZOCO-2 and the possible PEF degradation pathways were proposed by combining the determination of PEF degradation intermediates by HPLC-MS. The ZOCO-2/PMS system also exhibited good recyclability with over 90% PFX removal after five cycles, and good performance for other organic pollutants, i.e. rhodamine B, malachite green, levofloxacin, tetracycline hydrochloride, gatifloxacin and ciprofloxacin.