Livestock farms are important reservoirs of antibiotic resistance genes (ARGs). However, how wastewater irrigation from swine farms affects the surrounding environments, especially water bodies, is not fully understood. In this study, the occurrence pattern and potential risk of ARGs and mobile gene elements (MGEs) in a biogas slurry from a large-scale swine farm and its surrounding environments were investigated. Genes conferring resistance to tetracycline, sulfonamide, and multidrugs were found to be predominant in the biogas slurry, while sulfonamide and multidrug resistance genes exhibited the highest abundance in the surrounding environments. Overall, the total relative abundance of ARGs in the biogas slurry was 1.4-7 fold higher than that in the surrounding environments. PCA revealed the cluster pattern of samples based on sample types and a better correlation between swine farm wastewater and groundwater. A higher abundance of ARGs was found in groundwater farther away from the swine farm than that in nearby groundwater and surface water. Correlation analysis indicated that ARGs had a significant positive correlation with MGEs at each sampling site. The most abundant MGE