Spatially heterogeneous ecosystems form a majority of land types in the vast drylands of the globe. To evaluate climate-change effects on CO2 fluxes in such ecosystems, it is critical to understand the relative responses of each ecosystem component (microsite). We investigated soil respiration (Rs) at four sites along an aridity gradient (90–780 mm mean annual precipitation, MAP) during almost 2 years. In addition, Rs was measured in rainfall manipulations plots at the two central sites where ∼30% droughting and ∼30% water supplementation treatments were used over 5 years. Annual Rs was higher by 23% under shrub canopies compared with herbaceous gaps between shrubs, but Rs at both microsites responded similarly to rainfall reduction. Decreasing precipitation and soil water content along the aridity gradient and across rainfall manipulations resulted in a progressive decline in Rs at both microsites, i.e. the drier the conditions, the larger was the effect of reduction in water availability on Rs. Annual Rs on the ecosystem scale decreased at a slope of 256/MAP g C m−2 yr−1 mm−1 (r2=0.97). The reduction in Rs amounted to 77% along the aridity gradient and to 16% across rainfall manipulations. Soil organic carbon (SOC) decreased with declining precipitation, and variation in SOC stocks explained 77% of the variation in annual Rs across sites, rainfall manipulations and microsites. This study shows that rainfall manipulations over several years are a useful tool for experimentally predicting climate-change effects on CO2 fluxes for time scales (such as approximated by aridity gradients) that are beyond common research periods. Rainfall reduction decreases rates of Rs not only by lowering biological activity, but also by drastically reducing shrub cover. We postulate that future climate change in heterogeneous ecosystems, such as Mediterranean and deserts shrublands will have a major impact on Rs by feedbacks through changes in vegetation structure.