The aging of the rural population is one of the important social problems facing China and the world. To provide strategic support for coping with the challenges brought by an aging society, this study examined the impact of aging of the rural population on agricultural green total factor productivity (AGTFP) and the mechanism of transmission between them, based on the panel data of 31 provinces in China from 2000 to 2022. The results showed that, first, the aging of the rural population had a negative inhibitory effect on AGTFP, a conclusion that remained valid after a series of robustness tests. Second, the heterogeneity analysis showed that the aging of the rural population in western China had a significant negative impact on AGTFP, while the effect was less significant in eastern and central regions. The intensity of environmental regulation will increase the negative impact of an aging rural population on AGTFP. Third, the analysis of the mechanism showed that the aging of the rural population had a negative impact on AGTFP by inhibiting labor productivity, scientific research and innovation, and farmland transfer.