Sepsis-associated encephalopathy (SAE) is a poorly understood condition that leads to long-term cognitive impairment and increased mortality in survivors. Recent research revealed that IL-17A/IL-17R might serve as a checkpoint in microglia-mediated neuroinflammation. The present study was designed to determine the specific role of IL-17A-mediated microglia activation in the development of SAE. A mouse model of SAE was induced by cecal ligation and puncture (CLP), and behavior performance was evaluated by the inhibitory avoidance test and the open field test. Cytokine expression and microglia activation in brain tissue were determined at 6 h, 12 h, 24 h, 48 h, and day 7 post surgery. Further, septic mice were intracerebral ventricle- (i.c.v.-) injected with recombinant IL-17A, anti-IL-17A ab, anti-IL-17R ab, or isotype controls to evaluate the potential effects of IL-17A/IL-17R blockade in the prevention of SAE. Septic peritonitis induced significant impairment of learning memory and exploratory activity, which was associated with a higher expression of IL-17A, IL-1β, and TNF-α in the brain homogenate. Fluorescence intensity of Iba-1 and IL-17R in the hippocampus was significantly increased following CLP. Treatment with recombinant IL-17A enhanced the neuroinflammation and microglia activation in CLP mice. On the contrary, neutralizing anti-IL-17A or anti-IL-17R antibodies mitigated the CNS inflammation and microglia activation, thus alleviating the cognitive dysfunction. Furthermore, as compared to the sham control, microglia cultured from CLP mice produced significantly higher levels of cytokines and expressed with higher fluorescence intensity of Iba-1 in response to IL-17A or LPS. Pretreatment with anti-IL-17R ab suppressed the Iba-1 expression and cytokine production in microglia stimulated by IL-17A. In conclusion, blockade of the IL-17A/IL-17R pathway inhibited microglia activation and neuroinflammation, thereby partially reversing sepsis-induced cognitive impairment. The present study suggested that the IL-17A/IL-17R signaling pathway had an important, nonredundant role in the development of SAE.