We aimed to investigate the neuroprotective effect of Echinacoside (ECH) extracted from Cistanche tubulosa (Schenk) Wight in a mouse model of LPS-induced neuroinflammation and associated memory impairment, and the potential role of the microbiota-gut-brain axis (MGBA) in this process. Intraperitoneal injection of LPS in mice can induce inflammation, causing learning and memory impairment, and it can also affect the balance of the intestinal flora. The Morris water maze (MWM) experiment, immunohistochemistry, immunofluorescence chemistry, Nissl staining, and 16S rRNA gene sequencing of the mice intestinal flora were performed for the study. The results of the MWM experiment showed that mice treated with ECH were able to find the platform faster compared to the model group, with shorter distances moved than the C. tubulosa (Schenk) Wight extract (CTE) group, and they had more platform crossings. Immunofluorescence staining of brain cortex and hippocampal tissues showed that ECH could attenuate LPS-induced neuronal damage and reduce the expression levels of Ionized calcium-binding adapter molecule 1 (Iba-1) positive cells and the Tumor Necrosis Factor-alpha (TNF-α). 16S rRNA gene sequencing of mice intestinal flora revealed that ECH exerted beneficial effects by reshaping the structure of the intestinal flora. Our findings suggest that ECH may be beneficial for alleviating neuroinflammation-related cognitive impairments, providing theoretical support for a new neuro-psycho-pharmacological approach to MGBA-related diseases through restoring intestinal flora homeostasis.