We attempt, for the first time, to estimate the surface carbon flux by the method of automatic differentiation. The atmospheric transport model is developed using a deep learning framework and is validated against standard approaches. Depends on the built-in automatic differentiation feature of the deep learning framework, the system derivatives/gradients are readily available without any extra effort. We then formulate the surface carbon flux estimation as an inverse problem using the variational approach, driven by back-propagated objective gradients. The feasibility of the automatic differentiation method is demonstrated in identical-twin observing system simulation experiments (OSSEs). The proposed framework shows favorable accuracy and great efficiency in both fully and partially observable scenarios. The present study establishes a link between machine learning frameworks and general data assimilation or inverse modeling problems, and the promising results encourage more investigations in incorporating machine learning techniques in inverse carbon modeling.