China repeatedly surpasses international fertilizer safety limits, resulting in significant fertilizer nonpoint source pollution (denoted as FNSP), which adversely affects food security and agricultural sustainability. Simultaneously, farmland transfer has emerged as a pivotal strategy for transitioning between agricultural production methods. The present study aims to investigate the relationship between farmland transfer and FNSP. In line with the aim of the study, based on China’s panel data from 2005 to 2020, the fixed-effect model, mediating-effect model, spatial Durbin model, and threshold regression model are employed. The findings reveal that farmland transfer exerts a significant inhibitory effect on FNSP. The reduction in FNSP through farmland transfer is facilitated by the decrease in fertilizer application intensity and increase in compound fertilizer application. Further, farmland transfer demonstrates a significant spatial spillover effect on FNSP, mitigating pollution levels within regions and influencing neighboring areas. Moreover, a nonlinear relationship between farmland transfer and FNSP is observed. These findings contribute to understanding the intricate dynamics between agricultural land management strategies and environmental sustainability, offering valuable insights for policymakers and stakeholders engaged in promoting green and sustainable agricultural practices.