Self-generated sensory stimulation can be distinguished from externally generated stimulation that is otherwise identical. To determine how the brain differentiates external from self-generated noxious stimulation and which structures of the lateral pain system use neural signals to predict the sensory consequences of self-generated painful stimulation, we used functional magnetic resonance imaging to examine healthy human subjects who received thermal-contact stimuli with noxious and non-noxious temperatures on the resting right hand in random order. These stimuli were internally (self-generated) or externally generated. Two additional conditions served as control conditions: to account for stimulus onset uncertainty, acoustic stimuli preceding the same thermal stimuli were used with variable or fixed delays but without any stimulus-eliciting movements. Whereas graded pain-related activity in the insula and secondary somatosensory cortex (SII) was independent of how the stimulus was generated, it was attenuated in the primary somatosensory cortex (SI) during self-generated stimulation. These data agree with recent concepts of the parallel processing of nociceptive signals to the primary and secondary somatosensory cortices. They also suggest that brain areas that encode pain intensity do not distinguish between internally or externally applied noxious stimuli, i.e., this adaptive biological mechanism prevents harm to the individual. The attenuated activation of SI during self-generated painful stimulation might be a result of the predictability of the sensory consequences of the pain-related action. Hum Brain Mapp, 2006. © 2006 Wiley-Liss, Inc.