In this study, we investigated lipopolysaccharide (LPS)-induced cognitive impairment and neuroinflammation in C57BL/6J mice by using behavioral tests, immunofluorescence, enzyme-linked immunosorbent assay (ELISA) and Western blot. We found that LPS treatment leads to sickness behavior and cognitive impairment in mice as shown in the Morris water maze and passive avoidance test, and these effects were accompanied by microglia activation (labeled by ionized calcium binding adaptor molecule-1, IBA-1) and neuronal cell loss (labeled by microtubule-associated protein 2, MAP-2) in the hippocampus. The levels of interleukin-4 (IL-4) and interleukin-10 (IL-10) in the serum and brain homogenates were reduced by the LPS treatment, while the levels of tumor necrosis factor-α (TNF-α), interleukin-1β (IL-1β), prostaglandin E2 (PGE2) and nitric oxide (NO) were increased. In addition, LPS promoted the expression of cyclooxygenase-2 (COX-2) and inducible nitric oxide synthase (iNOS) in the brain homogenates. The Western blot analysis showed that the nuclear factor kappa B (NF-κB) signaling pathway was activated in the LPS groups. Furthermore, VIPER, which is a TLR-4-specific inhibitory peptide, prevented the LPS-induced neuroinflammation and cognitive impairment. These data suggest that LPS induced cognitive impairment and neuroinflammation via microglia activation by activating the NF-kB signaling pathway; furthermore, we compared the time points, doses, methods and outcomes of LPS administration between intraperitoneal and intracerebroventricular injections of LPS in LPS-induced neuroinflammation and cognitive impairment, and these data may provide additional insight for researchers performing neuroinflammation research.