Previously, hepatic ischemia followed by reperfusion (hepatic I/R) has been found to cause cognitive impairment. Hydrogen sulfide (H 2 S) attenuates hepatectomy induced cognitive deficits and also protects against cognitive dysfunction induced by neurodegenerative diseases. In this study, we aim to determine whether sodium hydrosulfide (NaHS), a H 2 S donor, could alleviate hepatic I/R-induced cognitive impairment and the underlying mechanisms. Rats were injected intraperitoneally with NaHS (5 mg/kg/d) for 11 days. A segmental hepatic I/R model was established on the fourth day. Cognitive function, proinflammatory cytokines levels, and hippocampal ionized calcium-binding adaptor molecule 1 (Iba1) expression was analyzed. We found hepatic I/R increased proinflammatory cytokines levels in serum and hippocampus, up-regulated Iba1 expression, leading to cognitive impairment in rats. However, treatment with NaHS alleviated hepatic I/R induced these neuroinflammatory changes and effectively improved cognitive function. Thus, NaHS appears to protect against cognitive impairment in rats undergoing hepatic I/R by attenuating neuroinflammation in the hippocampus.