Agricultural sustainability is crucial for ensuring food security, promoting economic development, maintaining ecological balance, and achieving sustainable development goals. In this study, based on relevant theories of agricultural sustainability, an analytical framework is constructed for agricultural sustainability encompassing economic, resource, environmental, and social dimensions. The Analytic Network Process (ANP) method is employed to determine indicator weights and assess the spatiotemporal changes in agricultural sustainability levels across Chinese provinces. The findings reveal that environmental quality is the primary dimension for assessing agricultural sustainability, and the significance of the rural social development dimension is continuously increasing. Although the sustainability levels have significantly improved in various regions of China, there remain issues of development imbalance and instability. In conclusion, this paper offers a comprehensive understanding of the spatiotemporal changes in agricultural sustainability across Chinese provinces, providing valuable insights for policymakers and researchers.