PurposeThis study aims to examine the complex effects of foreign direct investment (FDI) on China’s agricultural total factor productivity (TFP) from 2005 to 2020. It also explores the role of absorptive capacity as a moderating factor during this period.Design/methodology/approachEmploying provincial panel data from China, this research measures agricultural TFP using the Stochastic Frontier Approach (SFA)-Malmquist method. The impact of FDI on agricultural productivity is further analyzed using a nondynamic panel threshold model.FindingsThe results highlight technological progress as the main driver of agricultural TFP growth in China. Agricultural FDI (AFDI) seems to impede TFP development, whereas nonagricultural FDI (NAFDI) shows a distinct positive spillover effect. The study reveals a threshold in absorptive capacity that affects both the direct and spillover impacts of FDI. Provinces with higher absorptive capacity are less negatively impacted by AFDI and more likely to benefit from FDI spillovers (FDISs).Originality/valueThis study provides new insights into the intricate relationship between FDI, absorptive capacity and agricultural productivity. It underscores the importance of optimizing technological progress and research and development (R&D) to enhance agricultural productivity in China.