© 2018, The Author(s), under exclusive licence to Springer Nature Limited. The carbon sink potential of peatlands depends on the balance of carbon uptake by plants and microbial decomposition. The rates of both these processes will increase with warming but it remains unclear which will dominate the global peatland response. Here we examine the global relationship between peatland carbon accumulation rates during the last millennium and planetary-scale climate space. A positive relationship is found between carbon accumulation and cumulative photosynthetically active radiation during the growing season for mid- to high-latitude peatlands in both hemispheres. However, this relationship reverses at lower latitudes, suggesting that carbon accumulation is lower under the warmest climate regimes. Projections under Representative Concentration Pathway (RCP)2.6 and RCP8.5 scenarios indicate that the present-day global sink will increase slightly until around ad 2100 but decline thereafter. Peatlands will remain a carbon sink in the future, but their response to warming switches from a negative to a positive climate feedback (decreased carbon sink with warming) at the end of the twenty-first century.