Cerebral ischemia leads to neuroinflammation and activation of microglia which further contribute to stroke pathology. Understanding regulation of microglial activation will aid in the development of therapeutic strategies that mitigate microglia-mediated neurotoxicity in neuropathologies, including ischemia. In this study, we investigated the epigenetic regulation of microglial activation by studying histone modification histone 3-lysine 9-acetylation (H3K9ac) and its regulation by histone deacetylase (HDAC) inhibitors. In vitro analysis of activated microglia showed that HDAC inhibitor, sodium butyrate (SB), alters H3K9ac enrichment and transcription at the promoters of pro-inflammatory (Tnf-α, Nos2, Stat1, Il6) and anti-inflammatory (Il10) genes while inducing the expression of genes downstream of the IL10/STAT3 anti-inflammatory pathway. In an experimental mouse (C57BL/6NTac) model of middle cerebral artery occlusion (MCAO), we observed that SB mediates neuroprotection by epigenetically regulating the microglial inflammatory response, via downregulating the expression of pro-inflammatory mediators, TNF-α and NOS2, and upregulating the expression of anti-inflammatory mediator IL10, in activated microglia. Interestingly, H3K9ac levels were found to be upregulated in activated microglia distributed in the cortex, striatum, and hippocampus of MCAO mice. A similar upregulation of H3K9ac was detected in lipopolysaccharide (LPS)-activated microglia in the Wistar rat brain, indicating that H3K9ac upregulation is consistently associated with microglial activation in vivo. Altogether, these results show evidence of HDAC inhibition being a promising molecular switch to epigenetically modify microglial behavior from pro-inflammatory to anti-inflammatory which could mitigate microglia-mediated neuroinflammation.