In mouse the cannabinoid receptor 2 (CB2) agonists L768242 and (+)-AM1241, at doses of 30 mg/kg i.p. and 1 and 3 mg/kg i.v., respectively, reduced the second phase of nocifensive behaviors elicited by formalin intraplantar injection. This effect was counteracted by the selective CB2 antagonist SR144528 (1 mg/kg i.p.). In rat (+)-AM1241 (3 and 6 mg/kg i.v.) and L768242 (30 mg/kg i.p.) reduced allodynia elicited by L5-L6 spinal nerve ligation. SR144528 reverted these effects, supporting a CB2-mediated action. To clarify the mechanisms underlying these effects we investigated CB2 gene expression and function in the nervous system. CB2 mRNA was expressed in spinal cord and dorsal root ganglia (DRG) of both sham and neuropathic rats and was up-regulated in the ipsilateral spinal cord of neuropathic rats. Expression studies demonstrated the presence of CB2 mRNA in culture of spinal cord microglia. A biomarker, CGRP, was used to investigate modulation of DRG primary afferents by CB2 agonists. Both L768242 and (+)-AM1241 dose dependently (EC50 of 3.6 and 4.5 nM, respectively) reduced capsaicin-induced calcitonin gene-related peptide (CGRP) release. Coadministration of SR144528 resulted in a rightforward shift (pKB 8.1 and 8.2 for (+)-AM1241 and L768242, respectively) of the dose-response curve. Experiments on capsaicin-induced CGRP release in tissue from CB1-/- mice ruled out a CB1-mediated effect. These results confirm that CB2 is present in the central nervous system and suggest that CB2 agonists may elicit their analgesic effect by acting not only at non-neuronal peripheral sites but also at neural level, making CB2 an attractive target for chronic pain treatment.