Purpose Denitrification is an important biochemical process in global nitrogen cycle, with a potent greenhouse gas product N 2 O. Wastewater irrigation can result in the changes of soil properties and microbial communities of agricultural soils. The purpose of this study was to examine how the soil denitrification genes responded to different irrigation regimes. Materials and methods Soil samples were collected from three rural districts of Beijing (China) with three different irrigation regimes: clean groundwater (CW), reclaimed water (RW), and wastewater (WW). The abundance and diversity of three denitrification microbial genes (nirS, nirK, and nosZ) were examined by real-time polymerase chain reaction (PCR) and denaturing gradient gel electrophoresis (DGGE) molecular approaches. Results and discussion The abundance of nirS in the WW treatment was higher than that in the CW treatment, and no significant difference was found between the RW and CW or WW treatments. The abundance of nirK gene of the RW and WW treatments was higher than that of the CW treatment. There was no difference for nosZ gene among the three treatments. Correspondence analysis based on the DGGE profiles showed that there was no obvious difference in the nosZ gene composition, but nirS and nirK genes changed with different irrigation regimes. Conclusions Irrigation with unclean water sources enhanced the soil NO 3 − content and changed the abundance and composition of soil denitrifiers, and different functional genes had different responses. Irrigation with unclean water sources increased the abundance of nirK gene and changed the community structures of nirS and nirK genes, while nosZ gene was relatively stable in the soil. These results could be helpful to explore the mechanisms of the variation of denitrification processes under long-term wastewater irrigation and partially explain the reason of more N 2 O output in the field with wastewater irrigation.