Memory impairment is one of the main characteristics of postoperative cognitive dysfunction. It remains elusive how postoperative pathological changes of the brain link to the memory impairment. The clinical setting of perioperation was mimicked via partial hepatectomy under sevoflurane anaesthesia together with preoperative restraint stress (Hep-Sev-stress) in mice. Memory changes were assessed with fear conditioning. The medial prefrontal cortex (mPFC)-dorsal hippocampus connectivity was evaluated with injecting neurotracer 28 days before surgery. Astrocytic activation was limited via injecting AAV-GFAP-hM4Di-eGFP into the mPFC. Astrocytic and microglial phagocytosis of synapses were visualised with co-labelling hippocampal neuronal axon terminals with PSD-95 and S100β or Iba1. Neuroinflammation and oxidative stress status were also detected. Hep-Sev-stress impaired the memory consolidation (mean [standard error], 49.91 [2.55]% vs. 35.40 [3.97]% in the contextual memory, p = 0.007; 40.72 [2.78]% vs. 27.77 [2.22]% in cued memory, p = 0.002) and the cued memory retrieval (39.00 [3.08]% vs. 24.11 [2.06]%, p = 0.001) in mice when compared with these in the naïve controls. Hep-Sev-stress damaged the connectivity from the dorsal hippocampus to mPFC but not from the mPFC to the dorsal hippocampus and increased the astrocytic but not microglial phagocytosis of hippocampal neuronal axon terminals in the mPFC. The intervention also induced neuroinflammation and oxidative stress in the dorsal hippocampus and the mPFC in a regional-dependent manner. Limiting astrocyte activation in the mPFC alleviated memory consolidation impairment induced by Hep-Sev-stress. Postoperative memory consolidation was impaired due to astrocytic phagocytosis-induced connectivity injury from the dorsal hippocampus to the medial prefrontal cortex.