Pain can be modulated by several cognitive techniques, typically involving increased cognitive control and decreased sensory processing. Recently, it has been demonstrated that pain can also be attenuated by mindfulness. Here, we investigate the underlying brain mechanisms by which the state of mindfulness reduces pain. Mindfulness practitioners and controls received unpleasant electric stimuli in the functional magnetic resonance imaging scanner during a mindfulness and a control condition. Mindfulness practitioners, but not controls, were able to reduce pain unpleasantness by 22% and anticipatory anxiety by 29% during a mindful state. In the brain, this reduction was associated with decreased activation in the lateral prefrontal cortex and increased activation in the right posterior insula during stimulation and increased rostral anterior cingulate cortex activation during the anticipation of pain. These findings reveal a unique mechanism of pain modulation, comprising increased sensory processing and decreased cognitive control, and are in sharp contrast to established pain modulation mechanisms.