A total of 58 water and sediment samples were collected in the typical sampling section of the Xining section of the Huangshui River during the wet season (July 2018) and the dry season (April 2019), respectively, and 6 wastewater samples were directly taken from the effluents of wastewater treatment plants (WWTPs) in the dry season. A total of 12 nitrogen functional genes were quantitatively analyzed by real-time fluorescence quanti-tative PCR technology (qPCR). The results showed that the average of total nitrogen (TN) concentration in Huangshui River was 3.06±1.23 (1.308–6.51) mg/L. The nitrogen functional genes with high relative abundance in water and sediments were narG, nirS and nosZ. There were significant seasonal differences in the abundance and composition of nitrogen functional genes in sediments rather than those in water. The key nitrogen transformation process was denitrification, and its average contribution to nitrogen removal in water and sediment were 88% and 98%, respectively. The nitrogen transformation process in water was mainly impacted by pH, TN and NO3--N, the ammonia oxidation process was negatively correlated with the NO3--N concentration, and the denitrification process was negatively correlated with the pH. The nitrogen transformation process in sediment was mainly related to the water nitrogen concentration, sediment pH, TN, total phosphorus and organic carbon concentration, etc., the ammonia oxidation process was negatively related to the water nitrogen concentration, and the denitrification process was related to the sediment properties. Further analysis showed that the wastewater treatment plant effluents significantly reduced the abundance of genes such as AOA-amoA, CMX-amoA, nirS, nxrB, napA, narG, hzsA in the received water, which might lead to the limitation of the denitrification, anammox, nitrification and comammox processes, but at the same time elevated the abundance of nrfA genes and increased the contribution rate of dissimilatory nitrate reduction to ammonium (DNRA) to nitrogen removal in water. The relative abundances, such as AOA-amoA, nxrB and CMX-amoA, were significantly reduced in the sediments in the affected river segments, and nitrification and comammox processes in sediments were suppressed. This study can provide a scientific basis for nitrogen pollution control in the Xining section of Huangshui River.