Sepsis-associated encephalopathy (SAE) is a clinical syndrome of brain dysfunction secondary to sepsis, which is characterized by long-term neurocognitive deficits such as memory, attention, and executive dysfunction. However, the mechanisms underlying SAE remain unclear. By using transcriptome sequencing approach, we showed that hippocampal S100A9 was significantly increased in sepsis induced by cecal ligation and puncture (CLP) or lipopolysaccharide (LPS) challenge. Thus, we used S100A9 inhibitor Paquinimod to study the role of S100A9 in cognitive impairments in CLP-induced and LPS-induced mice models of SAE. Sepsis survivor mice underwent behavioral tests or the hippocampal tissues subjected to Western blotting, real-time quantitative PCR, and immunohistochemistry. Our results showed that CLP-induced and LPS-induced memory impairments were accompanied with increased expressions of hippocampal microglia Iba1 and CD86 (M1 markers), but reduced expression of Arg1 (M2 marker). Notably, S100A9 inhibition significantly improved the survival rate and learning and memory impairments in sepsis survivors, with a shift from M1 to M2 phenotype. Taken together, our study suggests that S100A9 upregulation might contribute to learning and memory impairments by promoting microglia M1 polarization in sepsis survivors, whereas S100A9 inhibition might provide a potential therapeutic target for SAE.