Histone deacetylases (HDACs)-mediated epigenetic mechanisms play critical roles in the homeostasis of histone acetylation and gene transcription. HDAC inhibitors have displayed neuroprotective properties in animal models for various neurological diseases including Alzheimer's disease and ischaemic stroke. However, some studies have also reported that HDAC enzymes exert protective effects in several pathological conditions including ischaemic stress. The mixed results indicate the specific roles of each HDAC protein in different diseased states. However, the subtypes of HDACs associated with ischaemic stroke keep unclear. Therefore, in this study, we used an in vivo middle cerebral artery occlusion (MCAO) model and in vitro cell cultures by the model of oxygen glucose deprivation to investigate the expression patterns of HDACs and explore the roles of individual HDACs in ischaemic stroke. Our results showed that inhibition of NADPH oxidase activity ameliorated cerebral ischaemia/reperfusion (I/R) injury and among Zn2+-dependent HDACs, HDAC4 and HDAC5 were significantly decreased both in vivo and in vitro, which can be reversed by NADPH oxidase inhibitor apocynin. We further found that both HDAC4 and HDAC5 increased cell viability through inhibition of HMGB1, a central mediator of tissue damage following acute injury, expression and release in PC12 cells. Our results for the first time provide evidence that NADPH oxidase-mediated HDAC4 and HDAC5 expression contributes to cerebral ischaemia injury via HMGB1 signalling pathway, suggesting that it is important to elucidate the role of individual HDACs within the brain, and the development of HDAC inhibitors with improved specificity is required to develop effective therapeutic strategies to treat stroke.