Given the critical urgency to combat the escalating climate crisis and the continuous rise in agricultural carbon emissions (ACE) in China, accurately forecasting their future trends is crucial. This research employs the emission factor method to assess ACE throughout mainland China from 1993 to 2021. To refine our forecasting approach, both statistical and neural network methodologies were utilized to pinpoint key factors influencing ACE. We crafted forecasting models incorporating both deep learning techniques and traditional methods. Notably, the Tree-structured Parzen Estimator Bayesian Optimization (TPEBO) algorithm was applied to optimize Long Short-Term Memory (LSTM) neural networks, culminating in the creation of a superior integrated TPEBO-LSTM model that demonstrated strong performance across various datasets. The forecasting outcomes suggest that ACE in 24 provinces are expected to reach their zenith before 2030, primarily driven by farm operations, as well as livestock and poultry manure management. The result provides a significant forecasting tool for assessing agricultural carbon emissions in different regions, offering insights crucial for targeted mitigation strategies.