Leaching losses of nitrogen (N) from soil and atmospheric N deposition have led to widespread changes in plant community and microbial community composition, but our knowledge of the factors that determine ecosystem N retention is limited. A common feature of extensively managed, species-rich grasslands is that they have fungal-dominated microbial communities, which might reduce soil N losses and increase ecosystem N retention, which is pivotal for pollution mitigation and sustainable food production. However, the mechanisms that underpin improved N retention in extensively managed, species-rich grasslands are unclear. We combined a landscape-scale field study and glasshouse experiment to test how grassland management affects plant and soil N retention. Specifically, we hypothesised that extensively managed, species-rich grasslands of high conservation value would have lower N loss and greater N retention than intensively managed, species-poor grasslands, and that this would be due to a greater immobilisation of N by a more fungal-dominated microbial community. In the field study, we found that extensively managed, species-rich grasslands had lower N leaching losses. Soil inorganic N availability decreased with increasing abundance of fungi relative to bacteria, although the best predictor of soil N leaching was the C/N ratio of aboveground plant biomass. In the associated glasshouse experiment we found that retention of added 15N was greater in extensively than in intensively managed grasslands, which was attributed to a combination of greater root uptake and microbial immobilisation of 15N in the former, and that microbial immobilisation increased with increasing biomass and abundance of fungi. These findings show that grassland management affects mechanisms of N retention in soil through changes in root and microbial uptake of N. Moreover, they support the notion that microbial communities might be the key to improved N retention through tightening linkages between plants and microbes and reducing N availability.