The dynamics of soil organic carbon (SOC) stock is a vital element affecting the climate, and ecological restoration is potentially an effective measure to mitigate climate change by enhancing vegetation and soil carbon stocks and thereby offsetting greenhouse gas emissions. The Grain-for-Green project (GFGP) implemented in Chinese Loess Plateau (LP) since 1999 is one of the largest ecological restoration projects in the world. However, the contributions of ecological restoration and climate change to ecosystem soil carbon sequestration are still unclear. In this study, we improved a soil carbon decomposition framework by optimizing the initial SOC stock based on full spatial simulation of SOC and incorporating the priming effect to investigate the SOC dynamics across the LP GFGP region from 1982 through 2017. Our results indicated that SOC stock in the GFGP region increased by 20.18 Tg C from 1982 through 2017. Most portion (15.83 Tg C) of the SOC increase was accumulated when the GFGP was initiated, with a SOC sink of 16.12 Tg C owing to revegetation restoration and a carbon loss of 0.29 Tg C due to warming during this period. The relationships between SOC and forest canopy height and investigations on the SOC dynamics after afforestation revealed that the accumulation rate of SOC could be as high as 24.68 g C m-2 yr-1 during the 70 years following afforestation, and that SOC could decline thereafter (-8.89 g C m-2 yr-1), which was mainly caused by warming. This study provides a new method for quantifying the contribution of ecological restoration to SOC changes, and also cautions the potential risk of LP SOC loss in the mature forest soil under future warming.