If an individual can learn to directly control activation of localized regions within the brain, this approach might provide control over the neurophysiological mechanisms that mediate behavior and cognition and could potentially provide a different route for treating disease. Control over the endogenous pain modulatory system is a particularly important target because it could enable a unique mechanism for clinical control over pain. Here, we found that by using real-time functional MRI (rtfMRI) to guide training, subjects were able to learn to control activation in the rostral anterior cingulate cortex (rACC), a region putatively involved in pain perception and regulation. When subjects deliberately induced increases or decreases in rACC fMRI activation, there was a corresponding change in the perception of pain caused by an applied noxious thermal stimulus. Control experiments demonstrated that this effect was not observed after similar training conducted without rtfMRI information, or using rtfMRI information derived from a different brain region, or sham rtfMRI information derived previously from a different subject. Chronic pain patients were also trained to control activation in rACC and reported decreases in the ongoing level of chronic pain after training. These findings show that individuals can gain voluntary control over activation in a specific brain region given appropriate training, that voluntary control over activation in rACC leads to control over pain perception, and that these effects were powerful enough to impact severe, chronic clinical pain.