Cerebral ischemia-reperfusion injury may be treated by compounds that increase brain O-GlcNAcylation, such as a therapeutic amount of a compound that increases the hexosamine biosynthesis pathway flux that bypasses glutamine/fructose-6-phosphate amidotransferase 2 or a therapeutic amount of a compound that inhibits OGA. The initial and transient elevation of brain O-GlcNAcylation is neuroprotective and helps ameliorate cerebral ischemia-reperfusion injury when administered within three hours of the ischemia-reperfusion-induced brain injury and continues for at least two days.