The slowing of agricultural productivity growth globally over the past two decades has brought a new urgency to detect its drivers and potential solutions. We show that air pollution, particularly surface ozone (O3), is strongly associated with declining agricultural total factor productivity (TFP) in China. We employ machine learning algorithms to generate estimates of high-resolution surface O3 concentrations from 2002 to 2019. Results indicate that Chinas O3 pollution has intensified over this 18-year period. We coupled these O3 estimates with a statistical model to show that rising O3 pollution during nonwinter seasons has reduced agricultural TFP by 18% over the 2002-2015 period. Agricultural TFP is projected to increase by 60% if surface O3 concentrations were reduced to meet the WHO air quality standards. This productivity gain has the potential to counter expected productivity losses from 2°C warming.