Elevated inputs of nitrogen (N) fertilizer have played a key role in feeding an increasing global population, but also caused many environmental problems due to emissions of reactive N (Nr) to air and water worldwide, especially in China. To better understand the improvements to N management required to reduce impacts in China, we compiled a long-term N budget over the period 1961-2018, quantified historic changes in N inputs, crop uptakes and losses, and compared them with required N inputs to satisfy food security and critical N inputs to protect the environment in view of acceptable losses of ammonia to air and nitrate to water. Nitrogen inputs required to satisfy the food demand of China were 14, 21, 27 and 29 Tg N yr-1 in 1961, 1980, 2000 and 2018, respectively, while the actual N inputs were 4, 25, 39 and 48 Tg N yr-1, respectively, exceeding the required input after 1980. Since 2000, the actual N inputs also exceeded the critical N inputs in view of ammonia emissions to air (35 Tg N yr-1) and nitrate leaching to groundwater (28 Tg N yr-1) that are needed to protect biodiversity and human health. We show that a reduction in N input from 48 to 31 Tg N yr-1, which reconciles food production with environmental safety, can be achieved through the effective recycling of manure, balanced N fertilization and integrated soil-crop system management. Such a 'win-win' would improve air and water quality and protect the environment and human health through improved resource use efficiencies, reduced N fertilizer use and decreased Nr losses.