Excessive apoptosis and neuronal dysfunction are pathological features of ischemic stroke. Previous studies have demonstrated that astragalin (AST) exerted both anti‑apoptotic and anti‑inflammatory effects in several types of disease, although its potential effect in ischemic stroke remains unclear. The purpose of the present study was to investigate the effects of AST on cerebral ischemia/reperfusion (I/R)‑induced brain injury and the underlying mechanisms. Brain injury was assessed in an experimental rat model using measurement of neurological scores and inflammatory factors. To assess the role of AST in I/R‑induced brain injury and the potential mechanism of action, SH5Y were treated with thapsigargin and AST. Apoptotic rate and ER stress levels were measured by western blotting, reverse transcription‑quantitative PCR and immunofluorescence staining. It was discovered that AST significantly improved long‑term neurological outcomes in rats following cerebral I/R injury, through the attenuation of the expression levels of apoptotic proteins (Bax and cleaved‑caspase‑3) and the release of inflammatory cytokines, as well as upregulating the expression levels of the anti‑apoptotic protein Bcl‑2. Furthermore, AST attenuated the expression levels of the endoplasmic reticulum (ER) stress‑related protein, glucose‑regulated protein, 78 kDa, as well as its downstream apoptotic mediators (CHOP and caspase‑12). Thapsigargin‑induced ER stress activation and apoptosis were also attenuated by AST in an in vitro neuronal cell culture model. In conclusion, these results suggested that AST may protect against I/R‑induced brain injury, thus, highlighting its therapeutic potential in patients with ischemic stroke.