Miyun Reservoir plays a vital role as a source of drinking water for Beijing, however it grapples with nitrogen contamination issues that have been poorly understood in terms of their distribution, source, and associated health risks. This study addresses this knowledge gap by employing data on nitrate nitrogen (NO3--N), chloride (Cl-), dual isotopic compositions of NO3- (δ15N-NO3- and δ18O-NO3-) data in water ecosystems, systematically exploring the distribution, source and health risk of nitrogen contaminants in Miyun reservoir watersheds. The results showed that over the past 30years, surface water runoff has exhibited a notable decrease and periodic fluctuations due to the combined influence of climate and anthropogenic activities, while the total nitrogen (TN) concentration in aquatic ecosystems presented an annual fluctuating upward trend. The TN concentration in the wet season was predominantly elevated because a large amount of nitrogen contaminants migrated into water ecosystems through heavy rainfall or river erosion. The concentration of NO3--N, the main contaminant of the water ecosystems, showed distinct variations across different watersheds, followed as rivers over the Miyun reservoir. Moreover, NO3--N levels gradually increased from upstream to downstream in different basins. NO3--N in surface water was mainly derived from the mixture of agricultural ammonia fertilizer and sewage and manure, with a minority of samples potentially undergoing denitrification. Comparatively, the main sources of NO3--N in groundwater were soil N and sewage and manure, while the denitrification process was inactive. The carcinogenic risks caused by NO3--N in groundwater were deemed either nonexistent or minimal, while the focus should predominantly be on potential non-carcinogenic risks, particularly for infants and children. Therefore, it is crucial to perform proactive measures aimed at safeguarding water ecosystems, guided by an understanding of the distribution, sources, and associated risks of nitrogen contamination.