Graphitic carbon nitride (C3N4) is a kind of visible light-responsive photocatalyst that has been of great interest in wastewater treatment. However, its environmental impact and biological effect remains to be elucidated. This study investigated the effect of C3N4 nanosheets on bacterial abundance and antibiotic tolerance in wastewater. Interestingly, as compared to the wastewater containing the antibiotic ofloxacin alone, the wastewater containing both ofloxacin and C3N4 had much higher numbers of total living bacteria, but lower levels of the ofloxacin-resistant bacteria and the ofloxacin-resistant gene qnrS. The model bacterium Staphylococcus aureus was then used to explore the mechanism of C3N4-induced antibiotic tolerance. The nanosheets neither adsorbed the antibiotic nor promoted drug efflux, uncovering that drug adsorption and efflux were not involved in antibiotic tolerance. Further investigations revealed that the nanosheets, like arsenate and menadione, drastically reduced ATP levels and induced the production of reactive oxygen species for enhanced antibiotic tolerance. This study revealed an antibiotic-tolerating mechanism associated with C3N4-induced ATP depletion, and shed a light on the effect of photocatalysts on microbial ecology during their application in wastewater treatment.