Ischemic stroke is characterized by high morbidity and mortality and a lack of effective therapeutic interventions. Leptin plays an important role in regulating oxidative stress, angiogenesis, hematopoiesis, etc. Although recent studies have found a neuroprotective effect of leptin, little is known about its role in cerebral ischemia. This study explores the possible roles and potential preventative mechanisms of leptin in cerebral ischemia–reperfusion injury (CIRI). An in vivo middle cerebral artery occlusion/reperfusion (MCAO/R) mouse model was used to replicate the CIRI model, low (0.5 mg/kg), medium (1 mg/kg) and high (2 mg/kg) concentrations of leptin were injected intraperitoneally immediately after inserting the embolic line. After 1.5 h of ischemia and 24 h of reperfusion, we examined the neural function of the mice, collected brain tissue for histological examination, and screened for the optimal concentrations of leptin intervention. On this basis, we observed the changes of cortical apoptosis injury, intracellular calcium fluorescence intensity and astrocyte glial fibrillary acidic protein (GFAP) expression and morphological changes. In addition, we also tested the expression of transporters and metabolism-related enzymes (VGLUT-1, VGLUT-2, GLAST, GLT-1, GS, ATP1α1), the expression of inflammatory factors and the content of glutamate (Glu). Compared with the I/R group, we found that leptin improved neurological deficits, reduced the area of infarcts, maintained the normal morphology of astrocytes (AST), downregulated the expression of VGLUT-1, and upregulates the expression of GLT-1 and GLAST, thereby reducing the content of Glu in the synaptic cleft. Our studies suggest that leptin may have a neuroprotective effect by decreasing the excitotoxicity of glutamate.