Abstract Opioid use disorder (OUD) remains a major public health crisis, underscoring the urgent need for safer and more effective treatments. Cannabinoid CB2 receptor (CB2R) agonists show therapeutic promise for neuropsychiatric disorders and pain, with minimal psychoactive effects by themselves, but their potential in treating OUD is not well defined. Here, we report that MRI-2594, a novel, highly selective CB2R agonist, reduced heroin self-administration and heroin-primed reinstatement of drug-seeking behavior in rats. MRI-2594 produced modest analgesia by itself without impairing oxycodone-induced analgesia, hyperlocomotion, or causing sedation. Local infusion of MRI-2594 into the ventral tegmental area (VTA) or nucleus accumbens (NAc) also inhibited heroin self-administration in rats. Systemically administered MRI-2594 reduced dopamine (DA) release in the NAc, as measured by fiber photometry. In DAT-Cre mice, MRI-2594 attenuated brain-stimulation reward driven by optogenetic activation of VTA DA neurons – an effect blocked by the selective CB2R antagonist MRI-2687. To confirm CB2R mechanism, we generated a new strain of CB2-KO-eGFP mice in which the CB2R coding region was replaced with an eGFP reporter. Immunostaining revealed CB2R-driven GFP expression in tyrosine hydroxylase (TH)-positive VTA DA neurons of CB2-KO-eGFP, but not wild-type, mice. Lastly, MRI-2594 inhibited heroin self-administration in wild-type but not CB2-KO-eGFP mice. These findings demonstrate that brain CB2Rs mediate the anti-addictive effects of MRI-2594 and highlight CB2R as a potential target for OUD therapy.