Background : Cerebral ischemia/reperfusion (IR) after ischemic stroke causes microglial activation which lead to neuronal injury. Protein tyrosine phosphatase 1B (PTP1B) emerges to be a positive regulator of neuroinflammation, yet the effect of its inhibition on microglial activation as well as cerebral IR injury is largely unknown. Here we explored whether PTP1B inhibitor sc-222227 attenuates microglial activation and mitigates neuronal injury after cerebral IR injury. Methods : Cerebral IR injury rat model was induced by transient middle cerebral artery occlusion (MCAO) and reperfusion. PTP1B inhibitor sc-222227 was administered intracerebroventricularly 0.5 h before IR injury. Neurological deficits, infarct volume and brain water content were examined. In vitro IR injury model were established by oxygen glucose deprivation/reoxygenation (OGD/R) in rat primary microglia. PTP1B protein level, microglial activation, neuroinflammation, endoplasmic reticulum (ER) stress, autophagy and neuronal apoptosis were detected in vivo and/or in vitro using western blot, immunohistochemistry, immunofluorescence, ELISA and real-time PCR assay. Protein interaction were assessed by proximity ligation assay. Results : PTP1B expression were significantly increased after cerebral IR injury in vivo, and the enhancement was most prominent in microglia. PTP1B inhibitor reduced IR-induced microglial activation both in vitro and in vivo, and further attenuated IR-induced microglial ER stress and autophagy in rat. In vitro experiment showed PTP1B inhibitor mitigated OGD/R-induced microglial activation through inhibiting ER stress-dependent autophagy, whose effect was partly abolished by PERK activator CCT020312. The protein interaction between PTP1B and phosphorylated PERK were significantly increase in response to OGD/R in primary microglia. Finally, PTP1B inhibitor reduced neuronal apoptosis and improved neurologic function after cerebral IR injury in rat. Conclusions : PTP1B inhibitor ameliorated neuronal injury and neurologic deficits following cerebral IR injury via attenuating deleterious microglial activation and subsequent neuroinflammation through modulating ER stress-autophagy axis in microglia. Treatment targeting microglial PTP1B might be a potential therapeutic strategy for ischemic stroke treatment.