Background: cerebral ischemia/reperfusion (I/R) injury is an important complication of ischemic stroke, and autophagy is one of the mechanisms of it. In this study, we aimed to determine the role and mechanism of autophagy in cerebral I/R injury. Methods: the oxygen and glucose deprivation/reoxygenation (OGD/R) method was used to model cerebral I/R injury in HT22 cells. CCK-8 and LDH were conducted to detect viability and damage of the cells, respectively. Apoptosis was measured by flow cytometry and Tunel staining. Autophagic vesicles of HT22 cells were assessed by transmission electron microscopy. Western blotting analysis was used to examine the protein expression involving AMPK/DDiT4/mTOR axis and autophagy-related proteins. 3-Methyladenine and rapamycin were, respectively, used to inhibit and activate autophagy, compound C and AICAR acted as AMPK inhibitor and activator, respectively, and were used to control the starting link of AMPK/DDiT4/mTOR axis. Results: autophagy was activated in HT22 cells after OGD/R was characterized by an increased number of autophagic vesicles, the expression of Beclin1 and LC3II/LC3I, and a decrease in the expression of P62. Rapamycin could increase the viability, reduce LDH leakage rate, and alleviate cell apoptosis in OGD/R cells by activating autophagy. 3-Methyladenine played an opposite role to rapamycin in OGD/R cells. The expression of DDiT4 and the ratio of p-AMPK/AMPK were increased after OGD/R in HT22 cells. While the ratio of p-mTOR/mTOR was reduced by OGD/R, AICAR effectively increased the number of autophagic vesicles, improved viability, reduced LDH leakage rate, and alleviated apoptosis in HT22 cells which suffered OGD/R. However, the effects of compound C in OGD/R HT22 cells were opposite to that of AICAR. Conclusions: autophagy is activated after OGD/R; autophagy activator rapamycin significantly enhanced the protective effect of autophagy on cells of OGD/R. AMPK/DDiT4/mTOR axis is an important pathway to activate autophagy, and AMPK/DDiT4/mTOR-mediated autophagy significantly alleviates cell damage caused by OGD/R.