It is accepted that inflammatory mediators released from leukocytes contribute to the generation of pain. However, it is less well known that immune cells also produce mediators that can effectively counteract pain. These include anti-inflammatory cytokines and opioid peptides. This article concentrates on recent evidence that interactions between leukocyte-derived opioid peptides and their receptors on peripheral sensory neurons can result in potent, clinically relevant inhibition of pathological pain. Inflammation of peripheral tissues leads to increased synthesis and axonal transport of opioid receptors in dorsal root ganglion neurons. This results in opioid receptor upregulation and enhanced G-protein coupling at peripheral sensory nerve terminals. These events are dependent on neuronal electrical activity, production of proinflammatory cytokines and nerve growth factor within the inflamed tissue. Together with the disruption of the perineurial barrier, all these changes lead to an enhanced peripheral analgesic efficacy of opioids. The major source of local endogenous opioid ligands (beta-endorphin, enkephalins, endomorphins and dynorphin) are leukocytes. These cells contain and upregulate signal-sequence encoding mRNA of the beta-endorphin precursor proopiomelanocortin and the entire enzymatic machinery necessary for its processing into the functionally active peptide. Opioid-containing immune cells extravasate using adhesion molecules and chemokines to accumulate in inflamed tissues. Upon stressful stimuli or in response to releasing agents such as corticotropin-releasing factor, cytokines, chemokines and catecholamines, leukocytes secrete opioids. Depending on the cell type, this release is contingent on extracellular Ca(2+) or on inositol triphosphate receptor-triggered release of Ca(2+) from endoplasmic reticulum. Once secreted opioid peptides activate peripheral opioid receptors and produce analgesia by inhibiting the excitability of sensory nerves and/or the release of excitatory neuropeptides. These effects occur without central untoward side effects such as depression of breathing, clouding of consciousness or addiction. Future aims include the selective targeting of opioid-containing leukocytes to sites of painful injury and the augmentation of opioid peptide and receptor synthesis.