Neuroinflammation plays a critical role in the development of reward-related behavior in cocaine self-administration rodents. Cocaine, one of most commonly abused drugs, has been shown to activate microglia both in vitro and in vivo. Detailed molecular mechanisms underlying cocaine-mediated microglial activation remain poorly understood. microRNAs (miRs) belonging to a class of small noncoding RNA superfamily have been shown to modulate the activation status of microglia. miR-124, one of the microglia-enriched miRs, functions as an anti-inflammatory regulator that maintains microglia in a quiescent state. To date, the possible effects of cocaine on microglial miR-124 levels and the associated underlying mechanisms have not been explored. In the current study, we demonstrated that cocaine exposure decreased miR-124 levels in both BV-2 cells and rat primary microglia. These findings were further validated in vivo, wherein we demonstrated decreased abundance of miR-124 in purified microglia isolated from cocaine-administered mice brains compared with cells from saline administered animals. Molecular mechanisms underlying these effects involved cocaine-mediated increased mRNA and protein expression of DNMTs in microglia. Consistently, cocaine substantially increased promoter DNA methylation levels of miR-124 precursors (pri-miR-124-1 and -2), but not that of pri-miR-124-3, both in vitro and in vivo. In summary, our findings demonstrated that cocaine exposure increased DNA methylation of miR-124 promoter resulting into its downregulation, which, in turn, led to microglial activation. Our results thus implicate that epigenetic modulation of miR-124 could be considered as a potential therapeutic approach to ameliorate microglial activation and, possibly, the development of cocaine addiction.