Vermiremediation, which use earthworms to remove contaminants from soil, has been proven to be an alternative, low-cost technology. However, the effects of earthworm activity, especially the degraders in earthworm intestines, on the fate of sulfamethoxazole (SMX), and the effects of intestinal bacteria on degrading bacteria in soil are unclear. In this study, the effects of earthworms on the fate of SMX and related antibiotic resistance genes (ARGs) were investigated. Special attention was paid to the impact of earthworms on SMX degradation efficiency, degradation products, related ARGs, and degraders in both soil and earthworm intestines; the effect of intestinal bacteria on soil bacteria associated with SMX was also studied. Earthworms significantly accelerated SMX degradation by both intestinal detoxification and the stimulation of indigenous soil bacteria. Compared with the treatment without earthworms, the treatment with earthworms reduced SMX residues by 25.1 %, 49.2 %, 35.7 %, 34.2 %, and 35.7 % on the 10th, 20th, 30th, 60th, and 90th days, respectively. Compared with those in soil (treated with earthworms), the SMX residues in wormcasts were further reduced by 12.2–29.0 % from the 2nd to the 20th day, producing some unique anaerobic degradation products that were distinct from those in the soil. In earthworm intestines, SMX degradation was enhanced by bacteria of the genera Microvirga, Sphingomonas, Methylobacterium, Bacillus, and Tumebacillus. All of these bacteria (except Bacillus spp.) entered and colonised the soil with wormcasts, further promoting SMX degradation. Additionally, earthworms removed a significant number of ARGs by increasing the fraction of potential SMX degraders and inhibiting the potential hosts of ARGs and int1. This study demonstrated that earthworms could remediate SMX-contaminated soil by enhancing the removal of SMX and ARGs.