We analyse possible causes of twentieth century near-surface temperature change. We use an “optimal detection” methodology to compare seasonal and annual data from the coupled atmosphere-ocean general circulation model HadCM2 with observations averaged over a range of spatial and temporal scales. The results indicate that the increases in temperature observed in the latter half of the century have been caused by warming from anthropogenic increases in greenhouse gases offset by cooling from tropospheric sulfate aerosols rather than natural variability, either internal or externally forced. We also find that greenhouse gases are likely to have contributed significantly to the warming in the first half of the century. In addition, natural effects may have contributed to this warming. Assuming one particular reconstruction of total solar irradiance to be correct implies, when we take the seasonal cycle into account, that solar effects have contributed significantly to the warming observed in the early part of the century, regardless of any relative error in the amplitudes of the anthropogenic forcings prescribed in the model. However, this is not the case with an alternative reconstruction of total solar irradiance, based more on the amplitude than the length of the solar cycle. We also find evidence for volcanic influences on twentieth century near-surface temperatures. The signature of the eruption of Mount Pinatubo is detected using annual-mean data. We also find evidence for a volcanic influence on warming in the first half of the century associated with a reduction in mid-century volcanism.