As a result of global warming, precipitation is likely to increase in high latitudes and the tropics and to decrease in already dry subtropical regions. The absolute magnitude and regional details of such changes, however, remain intensely debated. As is well known from El Niño studies, sea-surface-temperature gradients across the tropical Pacific can strongly influence global rainfall. Palaeoproxy evidence indicates that the difference between the warm west Pacific and the colder east Pacific increased in past periods when the Earth warmed as a result of increased solar radiation. In contrast, in most model projections of future greenhouse warming this gradient weakens. It has not been clear how these two findings can be reconciled. Here we show in climate model simulations that the tropical Pacific sea-surface-temperature gradient increases when the warming is due to increased solar radiation and decreases when it is due to increased greenhouse-gas forcing. For the same global surface temperature increase the latter pattern produces less rainfall, notably over tropical land, which explains why in the model the late twentieth century is warmer than the Medieval Warm Period (~ AD 1000-1250) but precipitation is less. This difference is consistent with the global tropospheric energy budget, which requires a balance between the latent heat released in precipitation and radiative cooling. The tropospheric cooling is less for increased greenhouse gases, which add radiative absorbers to the troposphere, than for increased solar heating, which is concentrated at the Earth’s surface. Thus warming due to increased greenhouse gases produces a climate signature different from that of warming due to solar radiation changes.