Associative learning is thought to depend on detecting mismatches between actual and expected experiences. With functional magnetic resonance imaging (FMRI), we studied brain activity during different types of mismatch in a paradigm where contrasting-colored lights signaled the delivery of painful heat, nonpainful warmth, or no stimulation. When painful heat stimulation was unexpected, there was increased FMRI signal intensity in areas of the hippocampus, superior frontal gyrus, cerebellum, and superior parietal gyrus that was not found with mismatch between expectation and delivery of nonpainful warmth stimulation. When painful heat stimulation was unexpectedly omitted, the FMRI signal intensity decreased in the left superior parietal gyrus and increased in the other regions. These contrasting activation patterns correspond to two different mismatch concepts in theories of associative learning (Rescorla-Wagner, temporal difference vs. Pearce-Hall, Mackintosh). Searching for interventions to specifically modulate activation of these brain regions therefore offers an approach to identifying new treatments for chronic pain, which often has a substantial associative learning component.