Global peatlands store more carbon than is naturally present in the atmosphere1,2. However, many peatlands are under pressure from drainage-based agriculture, plantation development and fire, with the equivalent of around 3% of all anthropogenic greenhouse gases emitted from drained peatland3–5. Efforts to curb such emissions are intensifying through the conservation of undrained peatlands and rewetting of drained systems6. Here we report CO2 eddy covariance data from 16 locations and CH4 data from 41 locations in the British Isles, and combine them with published data from sites across all major peatland biomes. We find that the mean annual effective water-table depth (WTDe; that is, the average depth of the aerated peat layer) overrides all other ecosystem- and management-related controls on greenhouse gas fluxes. We estimate that every 10 cm of reduction in WTDe could reduce the net warming impact of CO2 and CH4 emissions (100-year Global Warming Potentials) by at least 3 t CO2e ha-1 yr-1, until WTDe is < 30 cm. Raising water levels further would continue to have a net cooling effect until WTDe is < 10 cm. Our results suggest that greenhouse gas emissions from peatlands drained for agriculture could be greatly reduced without necessarily halting their productive use. Halving WTDe in all drained agricultural peatlands, for example, could reduce emissions by the equivalent of over 1% of global anthropogenic emissions.