Abstract. Climatic and land management factors, such as water availability and grazing intensity, play an important role in seasonal and annual variability of the ecosystem–atmosphere exchange of CO2 in semi-arid ecosystems. However, the semi-arid South African ecosystems have been poorly studied. Four years of measurements (November 2015–October 2019) were collected and analysed from two eddy covariance towers near Middelburg in the Karoo, Eastern Cape, South Africa. We studied the impact of grazing intensity on the CO2 exchange by comparing seasonal and interannual CO2 fluxes for two sites with almost identical climatic conditions but different intensity of current and historical livestock grazing. The first site represents lenient grazing (LG) and the vegetation comprises a diverse balance of dwarf shrubs and grasses, while the second site has been degraded through heavy grazing (HG) in the past but then rested for the past 10 years and mainly consists of unpalatable grasses and ephemeral species. Over the observation period, we found that the LG site was a considerable carbon source (82.11 g C m−2), while the HG site was a slight carbon sink (−36.43 g C m−2). The annual carbon budgets ranged from −90 ± 51 g C m−2 yr−1 to 84 ± 43 g C m−2 yr−1 for the LG site and from −92 ± 66 g C m−2 yr−1 to 59 ± 46 g C m−2 yr−1 for the heavily grazed site over the four years of eddy covariance measurements. The significant variation in carbon sequestration rates between the last two years of measurement was explained by water availability (25 % of the precipitation deficit in 2019 compared to the long-term mean precipitation). This indicates that studied ecosystems can quickly switch from a considerable carbon sink to a considerable carbon source ecosystem. Our study shows that the CO2 dynamics in the Karoo are largely driven by water availability and the current and historical effects of livestock grazing intensity on aboveground biomass (AGB). The higher carbon uptake at the HG site indicates that resting period after overgrazing, together with the transition to unpalatable drought-tolerant grass species, creates conditions that are favourable for carbon sequestration in the Karoo ecosystems, but unproductive as Dorper sheep pasture. Furthermore, we observed a slight decrease in carbon uptake peaks at the HG site in response to resuming continuous grazing (July 2017).