Our results demonstrated that: (1) neuroinflammation in microglia contributed to cognitive impairment after SAH; and (2) H2S reduced cognitive impairment in rats after SAH, probably by ameliorating the neuroinflammation mediated by the TLR4/NF-κB pathway in microglia. The gene discussed is NFKB1; the disease is Cognitive impairment.