Anaerobic membrane bioreactor (AnMBR) is a potential candidate for high-strength pharmaceutical wastewater treatment. However, its contribution to reduce the antibiotic and antibiotic resistance genes (ARGs) is still largely unclear. Herein, this study investigated the antibiotics and ARGs removal in AnMBR for real high-strength antibiotic (levofloxacin (LEV)) pharmaceutical wastewater treatment, focusing on the positive effect of membrane fouling layers (biofilms). Results indicated that membrane biofilm has a positive effect on AnMBR treatment with improved COD and LEV removal efficiency by 12% and 10%, respectively. This might be ascribed to the enhanced biodegradation ability of the organic matter by the biofilm due to the enrichment of fermentation bacteria (Anaerobium), hydrogen-producing bacteria (Clostridium_sensu_stricto_1) and hydrogenotrophic methanogenic archaea (Methanobacterium and Methanobrevibacter). Importantly, the membrane biofilm can also effectively mitigate the ARGs (qnrS, qnrA) and class 1 integrator (intI1) dissemination and the absolute abundance of ARGs in the medium fouling (MF) biofilm effluent was 0.27 orders of magnitude lower than that of low fouling (LF) biofilm effluent. This can be explained by the variation of membrane surface becoming more hydrophobic in MF than LF biofilm with increased contact angle and more negative surface zeta potential, suggesting higher adsorption and adhesion properties. The strong correlation between extracellular polymer substance (EPS) and soluble microbial product (SMP) contents and qnrA, qnrS and intI1 further indicated the important role of EPS and SMP in membrane biofilm on ARGs reduction. Furthermore, the entrapment of ARGs potential hosts bacteria of Comamonas and Enterococcus with high biofilm formation potential also attributed to the improved ARGs removal with the increase of membrane fouling degree. Our findings suggest that AnMBR is effective for antibiotic pharmaceutical wastewater treatment and membrane biofilm has a positive effect on antibiotic and ARGs removal, which promotes the AnMBR application in the pharmaceutical industry.