As photocatalysts applied more and more often to treat pollutants by photocatalytic reactions, they may enter the environment via water spreading. Although there are some investigations about their influence on different organisms, little is known about its impact on the ecological microenvironment. To understand how photocatalysts effect sediment ecological microenvironment in the process of pollution remediation, the impact of typical photocatalyst g-C3N4 (Graphitic carbon nitride) on rivered sediment community polluted by typical antibiotic tetracycline (TC) was investigated. The sediment samples were exposed to different concentrations of TC, g-C3N4 or TC/g-C3N4 (exposed to 60, 120, 180 mg/L TC, or 25, 75, 125 mg/kg g-C3N4, or 25, 75, 125 mg/kg g-C3N4 plus 60, 120, 180 mg/L TC, respectively), and sediment bacterial community were analyzed by Illumina sequencing. The results indicated that the dominant bacterial phyla in the samples were Acidobacteriota, Proteobacteria, Actinobacteriota, Chloroflexi. The diversity and richness of microorganisms in riverbed sediment were increased a little bit by g-C3N4 with different concentrations, which reached the highest value when exposed to 75 mg/kg g-C3N4. g-C3N4 lightly increased the percentage of relative abundance of Cyanobacteria. The bacterial communities’ structure of the samples treated with TC, g-C3N4 or TC/g-C3N4 were distinguishable. g-C3N4 alone had little effect on microbial structure, while TC/g-C3N4 had medium influence and TC had great impact on it. Under TC stress, g-C3N4 slowed down the growth of Cyanobacteria to some extent and restored the changes of bacterial community structure caused by TC, and reduced the residual TC in water body, thus eliminating the side effects of TC. The result shown that g-C3N4 could significantly reduce the residue of TC in riverbed sediment, without affecting the microbial ecology in the environment.