The spatiotemporal variation of several carbapenemase-encoding genes (CRGs) was investigated in the influent and effluent of municipal WWTPs, with or without hospital sewage input. Correlations among gene abundances, bacterial community composition, and wastewater quality parameters were tested to identify possible predictors of CRGs presence. Also, the possible role of wastewaters in mirroring clinical resistance is discussed. The taxonomic groups and gene abundances showed an even distribution among wastewater types, meaning that hospital sewage does not influence the microbial diversity and the CRG pool. The bacterial community was composed mainly of Proteobacteria, Firmicutes, Actinobacteria, Patescibacteria, and Bacteroidetes. Acinetobacter spp. was the most abundant group and had the majority of operational taxonomic units (OTUs) positively correlated with CRGs. This agrees with recent reports on clinical data. The influent samples were dominated by bla KPC , as opposed to effluent, where bla IMP was dominant. Also, bla IMP was the most frequent CRG family observed to correlate with bacterial taxa, especially with the Mycobacterium genus in effluent samples. Bacterial load, bla NDM , bla KPC , and bla OXA-48 abundances were positively correlated with BOD 5 , TSS, HEM, Cr, Cu, and Fe concentrations in wastewaters. When influent gene abundance values were converted into population equivalent (PE) data, the highest copies/1 PE were identified for bla KPC and bla OXA-48 , agreeing with previous studies regarding clinical isolates. Both hospital and non-hospital-type samples followed a similar temporal trend of CRG incidence, but with differences among gene groups. Colder seasons favored the presence of bla NDM , bla KPC and bla OXA-48 , whereas warmer temperatures show increased PE values for bla VIM and bla IMP. IMPORTANCE Wastewater-based epidemiology has recently been recognized as a valuable , cost-effective tool for antimicrobial resistance surveillance. It can help gain insights into the characteristics and distribution of antibiotic resistance elements at a local, national, and even global scale. In this study, we investigated the possible use of municipal wastewaters in the surveillance of clinically relevant carbapenemase-encoding genes (CRGs), seen as critical antibiotic resistance determinants. In this matter, our results highlight positive correlations among CRGs, microbial diversity, and wastewater physical and chemical parameters. Identified predictors can provide valuable data regarding the level of raw and treated wastewater contamination with these important antibiotic resistance genes. Also, wastewater-based gene abundances were used for the first time to observe possible spatiotemporal trends of CRGs incidence in the general population. Therefore, possible hot spots of carbapenem resistance could be easily identified at the community level, surpassing the limitations of health care-associated settings.