Chronic postsurgical pain (CPSP) is a serious issue in clinical practice and severely affects patients' quality of life. Preoperative stress has been recognized as an independent risk factor for CPSP. However, it is unclear how preoperative stress influences postsurgical pain. Here we showed that preoperative single prolonged stress (SPS) significantly reduced liver X receptor β (LXRβ) in the anterior cingulate cortex (ACC) of mice with plantar incision and significantly prolonged postsurgical pain. Additionally, preoperative SPS markedly enhanced neuronal and microglial activation and induced overexpression of synapse-associated proteins in the ACC of incisional mice. The systemic administration of the LXR agonists GW3965 and LXR623 activates LXRβ, significantly inhibiting SPS-induced anxiety-like behaviors and pain hypersensitivity, as well as alleviating exacerbated postsurgical pain. This effect is accompanied by a reduction in both neuronal and microglial hyperactivation, along with a decrease in the overexpression of synapse-associated proteins in the ACC. Interestingly, intra-ACC microinjection of GSK2033, an LXRs antagonist mimicked the exacerbating effect of SPS on postsurgical pain. Therefore, LXRβ in the ACC contributes to the preoperative SPS-prolonged postsurgical pain by regulating neuronal and microglial activation, as well as synapse-associated proteins.