Our study explores the ecological niche and environmental adaptability of nirS- and nirK-type denitrifying microbial in the Yellow River estuary. Our findings indicate that anthropogenic nitrogen loading has precipitated substantial ecological challenges within these ecosystems. By assessing the biogeographical distribution and community assembly mechanisms of denitrifying microbial, we identified salinity as a pivotal factor influencing their diversity and prevalence, with increased salinity levels positively associated with enhanced microbial populations. Additionally, our research suggests that stochastic processes predominantly govern the assembly of nirS-type communities, whereas deterministic processes are more influential for nirK-type communities. Network analysis further revealed that denitrifying microbial communities in low-salinity areas exhibit greater complexity and modularity. Integrating microbial ecological and phylogenetic analysis with structural equation modeling, we established a link between microbial community characteristics and denitrification rates, underscoring the significance of microbial community understanding for effective ecosystem management.