To assess the preventive role of dexamethasone (Dex) in the development of neuroinflammation and concomitant neurocognitive disorders following acute inflammation. C57BL6 mice were fallen into the sham group, ischemia-reperfusion (I/R) group, and I/R + Dex group randomly. In the end, behavioral alterations were assessed with the Morris water maze (MWM) test, passive avoidance test (PAT), and open field test (OFT). The serum levels of IL-1β and TNF-α were detected by ELISA. Immunofluorescence was adopted to observe the NF-kB expression in the hippocampus. In addition, TLR4, NF-kB, CD68, and CD206 were examined by Western blot. The cognitive ability of mice can be impaired by tourniquet-induced acute inflammation, and these changes were prevented by Dex. Compared to the I/R group, Dex pretreatment could decrease levels of IL-1β and TNF-α proteins in serum. Besides, Dex preconditioning significantly decreased the utterance of NF-kB immunoreactive cells and TLR4, NF-kB, and CD68 overexpression in the hippocampus. Dex partly through inhibiting microglia transformation to the M1 polarization state and inactivating the TLR4/NF-kB pathway attenuates the cognitive disorders in mice.