Despite abundant expression of DNA methyltransferases (Dnmts) in brain, the regulation and behavioral role of DNA methylation remain poorly understood. We found that Dnmt3a expression was regulated in mouse nucleus accumbens (NAc) by chronic cocaine use and chronic social defeat stress. Moreover, NAc-specific manipulations that block DNA methylation potentiated cocaine reward and exerted antidepressant-like effects, whereas NAc-specific Dnmt3a overexpression attenuated cocaine reward and was pro-depressant. On a cellular level, we found that chronic cocaine use selectively increased thin dendritic spines on NAc neurons and that DNA methylation was both necessary and sufficient to mediate these effects. These data establish the importance of Dnmt3a in the NAc in regulating cellular and behavioral plasticity to emotional stimuli.