Ocean thermal expansion contributes significantly to sea-level variability and rise. However, observed decadal variability in ocean heat content and sea level has not been reproduced well in climate models. Aerosols injected into the stratosphere during volcanic eruptions scatter incoming solar radiation, and cause a rapid cooling of the atmosphere and a reduction in rainfall, as well as other changes in the climate system. Here we use observations of ocean heat content and a set of climate simulations to show that large volcanic eruptions result in rapid reductions in ocean heat content and global mean sea level. For the Mt Pinatubo eruption, we estimate a reduction in ocean heat content of about 3 x 10(22) J and a global sea-level fall of about 5 mm. Over the three years following such an eruption, we estimate a decrease in evaporation of up to 0.1 mm d(-1), comparable to observed changes in mean land precipitation. The recovery of sea level following the Mt Pinatubo eruption in 1991 explains about half of the difference between the long-term rate of sea-level rise of 1.8 mm yr(-1) (for 1950-2000), and the higher rate estimated for the more recent period where satellite altimeter data are available (1993-2000).