Perception of pain offset is essential to free one from any aftereffects of nociception. Because patients with chronic pain show impaired temporal contrast of pain, we tested whether they show slower perception of pain offset after the end of a nociceptive stimulus compared with pain-free subjects. We sought for cerebral correlates for offset and aftereffects of pain using functional magnetic resonance imaging (fMRI). In 19 patients with chronic pain and 15 pain-free subjects, we gave 10 blocks of pain stimuli by a Peltier-type thermal stimulator on the left volar forearm and recorded pain intensity continuously by a visual analogue scale (VAS), while performing whole-brain fMRI. We measured latency to reach "no pain" after stimulus offset (VAS End Latency). We analyzed fMRI signal changes during cessation of pain and made a between-group comparison. Individual parameters were sought for correlations with the rumination score from the Pain Catastrophizing Scale. Patients showed a longer VAS End Latency, and a larger after-pain activity in the left middle temporal gyrus, the right parietal lobule and, after small-volume correction, the right dorsolateral prefrontal cortex than pain-free subjects. Both VAS End Latency and after-pain activity were positively correlated with the rumination score. Psychophysiological interaction analysis revealed that higher rumination scores were associated with weaker coupling between the middle temporal and prefrontal cortices in patients and pain-free subjects with positive rumination scores. We suggest a possible role for the middle temporal gyrus in mediating pain aftereffects and rumination, and its modulation by the prefrontal-temporal network.