The aims of the study were to use functional magnetic resonance imaging (fMRI) to 1) locate pain-related regions in the anterior cingulate cortex (ACC) of normal human subjects and 2) determine whether each subject's pain-related activation is congruent with ACC regions involved in attention-demanding cognitive processes. Ten normal subjects underwent fMRI with a 1.5-T standard commercial MRI scanner. A conventional gradient echo technique was used to obtain data from a single 4-mm sagittal slice of the left ACC, approximately 3.5 mm from midline. For each subject, interleaved sets of 6 images were obtained during a pain task, an attention-demanding task, and at rest, for a total of 36 images per task. Pain of different intensities was evoked via electrical stimulation of the right median nerve. The attention-demanding task consisted of silent word generation (verbal fluency). Additional experiments obtained data from the right ACC. A pixel-by-pixel statistical analysis of task versus rest images was used to determine task-related activated regions. The pain task resulted in a 1.6-4.0% increase in mean signal intensity within a small region of the ACC. The exact location of this activation varied from subject to subject, but was typically in the posterior part of area 24. The signal intensity changes within this region correlated with pain intensity reported by the subject. The attention-demanding tasks increased the mean signal intensity by 1.3-3.3% in a region anterior and/or superior to the pain-related activation in each subject. The activated region was typically larger than the pain-related activation. In some cases this activation was at or superior to the ACC border, near the supplementary motor area. These regions did not show any pain-intensity-related activation. In one subject both right and left ACC were imaged, revealing bilateral ACC activation during the attention task but only contralateral pain-related activation. These findings shed light on pain- and attention-related cognitive processes. The results provide evidence for a region in the posterior part of the ACC that is involved in pain and a more anterior region involved in other attention-demanding cognitive tasks.