The widespread occurrence of sulfamethoxazole (SMZ), one of the widely used antibiotics, in aqueous environments, poses a significant threat to ecosystem health. In this study, the combination of a biofilm-based treatment system and photocatalysis was explored for the effective removal of SMZ. Initially, sulfur-doped g-C3N4 (S-C3N4) was synthesized and then combined with Bi2O3 to improve the overall photocatalytic performance. Characterization of as-prepared photocatalysts was performed to understand the chemical structures, morphologies, and optical properties. Batch studies have shown that, at neutral pH, using 1 g/L of S-C3N4/Bi2O3 (CNBI) composite results in the removal of 87.2 % of SMZ with an initial concentration of 10 mg/L. In accordance with the scavenging study, O2–• was identified as the dominant reactive species for the degradation of SMZ. After that, the identification of SMZ degradation products was carried out, and possible degradation pathways were proposed. After obtaining the optimal dosage, continuous experimentation was conducted using a photocatalytic reactor coated with CNBI composite combined with anoxic/oxic moving bed biofilm reactor. The investigation of real municipal and hospital liquid wastes containing SMZ showed an overall total organic carbon removal of 87 % and 81 %, respectively. Economic assessment, including capital and operational expenditures and synthesis costs involved in photocatalyst material, was performed to check the feasibility of photocatalysis integrated with biological systems at large-scale treatment.