Based on the panel data for 30 provinces in China from 2004 to 2020, this study explores the impact of technological innovation and environmental regulation on agricultural green total factor productivity by using the dynamic spatial Durbin panel model and the spatial panel threshold regression model. The results show that technological innovation significantly contributes to the improvement of AGTFP. Such positive impact is derived from the direct effect of technological innovation within the local province and the spatial spillover effect of technological innovation in neighboring provinces. Additionally, environmental regulation has a significant double-threshold effect on the technological innovation - AGTFP relationship. Within medium-level environmental regulation, the positive impact of technological innovation on AGTFP achieves a leap forward. Therefore, technological innovation serves as a motivator of agricultural green development, and appropriate intensity of environmental regulation is recommended in the endeavor of promoting green total factor productivity by technological innovation.