Ischemic stroke is a leading cause of mortality and disability. diabetes mellitus, characterized by hyperglycemia, is a common concomitant disease of ischemic stroke, which is associated with autophagy dysfunction and blood-brain barrier (BBB) damage following cerebral ischemia/reperfusion (I/R) injury. At present, there is no effective treatment strategy for the disease. The purpose of the present study was to explore the molecular mechanisms underlying the protective effects of selenium on the BBB following I/R injury in hyperglycemic rats. Middle cerebral artery occlusion was performed in diabetic Sprague-dawley rats. Treatment with selenium and the autophagy inhibitor 3-methyladenine significantly reduced cerebral infarct volume, brain water content and Evans blue leakage, while increasing the expression of tight junction (TJ) proteins and decreasing that of autophagy-related proteins (P<0.05). In addition, selenium increased the phosphorylation levels of PI3K, AKT and mTOR (P<0.05). A mouse bEnd.3 brain microvascular endothelial cell line was co-cultured in vitro with an MA-h mouse astrocyte-hippocampal cell line to simulate the BBB. The cells were then subjected to hyperglycemia, followed by oxygen-glucose deprivation for 1 h and reoxygenation for 24 h. It was revealed that selenium increased TJ protein levels, reduced BBB permeability, decreased autophagy levels and enhanced the expression of phosphorylated (p)-AKT/AKT and p-mTOR/mTOR proteins (P<0.05). Treatment with wortmannin (an inhibitor of PI3K) significantly prevented the beneficial effects of selenium on the BBB, whereas insulin-like growth factor 1 (a PI3K activator) mimicked the effects of selenium. In conclusion, the present findings indicated that selenium can inhibit autophagy by regulating the PI3K/AKT/mTOR signaling pathway, significantly preventing BBB damage following cerebral I/R injury in hyperglycemic conditions.