Knowledge about cerebral mechanisms underlying pain perception and effect of analgesic drugs is important for developing methods for diagnosis and treatment of pain. The aim was to explore altered brain activation before and after morphine treatment using functional magnetic resonance imaging recorded during experimental painful heat stimulation. Functional magnetic resonance imaging data were recorded and analysed in 20 healthy volunteers (13 men and 7 women, 24.9 AE 2.6 years) in a randomized, double-blind, placebo-controlled, cross-over study. Painful stimulations were applied to the right forearm using a contact heat evoked potential stimulator (CHEPS) before and after treatment with 30 mg oral morphine and placebo. CHEPS stimulations before treatment induced activation in the anterior cingulate cortex, secondary somatosensory cortex/insula, thalamus and cerebellum (n = 16, p < 0.05). In response to morphine treatment, the spatial extent of these pain-specific areas decreased (n = 20). Reduced pain-induced activation was seen in the right insula, anterior cingulate cortex and inferior parietal cortex after morphine treatment compared to before treatment (n = 16, p < 0.05), and sensory ratings of pain perception were significantly reduced after morphine treatment (p = 0.02). No effect on pain-induced brain activation was seen after placebo treatment compared to before treatment (n = 12, p > 0.05). In conclusion, heat stimulation activated areas in the 'pain matrix' and a clinically relevant dose of orally administered morphine revealed significant changes in brain areas where opioidergic pathways are predominant. The method may be useful to investigate the mechanisms of analgesics.