Astrocytes may fail to perform their neuroprotective roles against cerebral ischemia/reperfusion (I/R) injury due to phenotypic transformation. We aimed to demonstrate the distinct roles of A1 astrocytes and A2 astrocytes on the blood-brain barrier (BBB) injury following cerebral I/R, and explore whether H2S-mediated A2 astrocytes polarization protects against BBB injury via inhibiting ROCK/NF-κB pathway. The mice cerebral I/R model and the oxygen-glucose deprivation/re‑oxygenation (OGD/R) model of astrocytes were used in present study. Cerebral I/R-induced BBB injury is evidenced by increased EB dye leakage and reduced expressions of ZO-1 and occludin in mice hippocampal tissues. We found that H2S-mediated A2 polarization and lipopolysaccharide (LPS)-induced polarization of A1 astrocytes respectively display beneficial and harmful role in BBB injury. Besides, harmful roles of A1 astrocytes in BBB injury can be reduced by H2S. Additionally, A1 astrocytes exhibit excessive activation of NF-κB and enhanced expressions of MMP9 and AQP4, which can be inhibited by H2S. Moreover, H2S-mediated polarization of A2 astrocyte displays enhanced phosphorylation and nuclear translocation of STAT3 and reduced expressions of MMP9 and AQP4. Importantly, ROCK inhibitor Fasudil likewise inhibits the activation of NF-κB and promotes STAT3 activation in OGD/R astrocytes, and NF-κB inhibitor BAY11-7082 reduces the expressions of MMP9 and AQP4 in OGD/R astrocytes. In conclusion, H2S-mediated polarization of A2 astrocyte protects against BBB injury following cerebral I/R, the mechanisms may be related to inhibition of ROCK/NF-κB pathway, and activation of STAT3.