Gastrodin (GAS), which is extracted from the Chinese herbal medicine Gastrodia elata Blume, has long been used to improve stroke, epilepsy, dizziness and dementia. However, the effects and underlying mechanisms of GAS on subacute phase cerebral ischemia-reperfusion (I/R) injury remain unknown. The aim of the present study was to investigate the effects and mechanisms of GAS on cerebral I/R injury in rats. The rats were pretreated with GAS by gavage for 7 days followed by I/R surgery, and were then treated with GAS for 7 days after I/R surgery. Neurological deficits were assessed on days 1, 3 and 7 post-cerebral I/R injury. 2,3,5-Triphenyltetrazolium chloride staining was using to measure the infarct volume; morphological alterations were observed by hematoxylin and eosin staining under an optical microscope; apoptosis in the hippocampus and cortex was observed by terminal deoxynucleotidyl transferase dUTP nick end labeling staining; and the level of mRNA and protein expression was tested by reverse transcription-quantitative polymerase chain reation and western blot analysis, respectively. GAS markedly attenuated I/R-induced disability and histological damage, alleviated neuronal apoptosis, and reduced the mRNA and protein expression levels of inflammatory and proapoptotic factors, including interleukin-1β, cyclooxygenase-2, inducible nitric oxide synthase and cleaved caspase-3. These findings suggested that GAS may ameliorate subacute phase cerebral I/R injury by inhibiting inflammation and apoptosis in rats; therefore, GAS may be considered a potential candidate for the treatment of cerebral ischemia.