It is known that pain perception can be altered by mood, attention and cognition, or by direct stimulation of the cerebral cortex, but we know little of the neural mechanisms underlying the cortical modulation of pain. One of the few cortical areas consistently activated by painful stimuli is the rostral agranular insular cortex (RAIC) where, as in other parts of the cortex, the neurotransmitter gamma-aminobutyric acid (GABA) robustly inhibits neuronal activity. Here we show that changes in GABA neurotransmission in the RAIC can raise or lower the pain threshold--producing analgesia or hyperalgesia, respectively--in freely moving rats. Locally increasing GABA, by using an enzyme inhibitor or gene transfer mediated by a viral vector, produces lasting analgesia by enhancing the descending inhibition of spinal nociceptive neurons. Selectively activating GABA(B)-receptor-bearing RAIC neurons produces hyperalgesia through projections to the amygdala, an area involved in pain and fear. Whereas most studies focus on the role of the cerebral cortex as the end point of nociceptive processing, we suggest that cerebral cortex activity can change the set-point of pain threshold in a top-down manner.