The invasion of woody vegetation into deserts, grasslands and savannas is generally thought to lead to an increase in the amount of carbon stored in those ecosystems. For this reason, shrub and forest expansion (for example, into grasslands) is also suggested to be a substantial, if uncertain, component of the terrestrial carbon sink. Here we investigate woody plant invasion along a precipitation gradient (200 to 1,100 mm yr(-1)) by comparing carbon and nitrogen budgets and soil delta(13)C profiles between six pairs of adjacent grasslands, in which one of each pair was invaded by woody species 30 to 100 years ago. We found a clear negative relationship between precipitation and changes in soil organic carbon and nitrogen content when grasslands were invaded by woody vegetation, with drier sites gaining, and wetter sites losing, soil organic carbon. Losses of soil organic carbon at the wetter sites were substantial enough to offset increases in plant biomass carbon, suggesting that current land-based assessments may overestimate carbon sinks. Assessments relying on carbon stored from woody plant invasions to balance emissions may therefore be incorrect.