Using inter-provincial panel data of 30 provinces in China from 2004 to 2020 and the stochastic frontier production function method, this paper empirically analyzes the impact of agricultural mechanization on agricultural green total factor productivity, and explores the path to improve agricultural green total factor productivity from the perspective of technology and energy consumption types.The results show that the agricultural mechanization has made significant contributions to the promotion of agricultural modernization in China over the years, while the traditional growth mode of agricultural mechanization has not fostered the progress of agricultural green technology.Moreover, it has exacerbated environmental pollution through fuel consumption and greenhouse gas emissions, which ultimately hinders the improvement of agricultural green total factor productivity.Therefore, it is necessary to pursue green transformation and upgrade of agricultural mechanization.This can be achieved by enhancing agricultural green mechanization technology and the use of green agricultural machinery to improve green total factor productivity, and promote agricultural green development.Additionally, efforts should be made to strengthen agricultural machinery technological innovation, facilitate the research and development as well as quantitative production of clean and green agricultural machinery.Optimizing support policies such as subsidies for machinery purchases and operation should be considered, with a focus on favoring green agricultural machinery.This will encourage the widespread adoption of green mechanization technologies such as straw returning, water-saving irrigation, and precision application of fertilizers.