Sulfamethoxazole (SMX), a common antibiotic, is frequently present in various wastewater sources and threatens ecological health. Biodegradation technology is a sustainable method for removing antibiotics in which biological graphene hydrogel (BGH) has an advantage in SMX removal. However, there is limited understanding of the environmentally friendly method for the formation of bio-graphene complexes and their mechanism in SMX removal. This research is focused on investigating and evaluating the performance of BGH cross-linked with sodium alginate in removing SMX, as well as the mechanisms involved in the removal process. The outcomes showed that the biocompatibility of alginate-BGH (A-BGH) allows for an increase in SMX removal, reaching up to 91.23 %. This improved SMX removal can be attributed to the fuller 3D porous structure and fewer oxygen-containing functional groups of A-BGH, which maintained the microbial community diversity. Therefore, microorganisms involved in SMX degradation, like Pseudomonas, Desulfomicrobium, and Desulfovibrio, maintained a comparable high abundance in A-BGH. This microbial community contributes to three major transformation pathways, including hydroxylation, NC bond cleavage, and N–S bond cleavage, thereby enhancing the SMX removal. The present finding demonstrated the effective adsorption and biodegradation behavior of A-BGH on SMX, indicating the A-BGH may serve as a promising material for aquatic environment remediation and wastewater treatment.