Postoperative pain following hemorrhoid surgery is often accompanied by emotional and cognitive disturbances, complicating recovery. Acupuncture has shown promise in modulating pain and related neuroinflammatory pathways. A rat model of mixed hemorrhoid surgery was established in seventy male Sprague-Dawley rats, and randomly divided into seven groups: control, model, acupuncture, non-acupoint acupuncture, P2X7 agonist (BzATP), normal saline, and acupuncture + agonist. Behavioral assays including open field, sucrose preference, and Von Frey tests evaluated motor activity, anhedonia, and mechanical pain threshold. ELISA measured IL-6 and TNF-α levels. ATP concentration was assessed by colorimetric assay. RT-qPCR quantified P2X7 mRNA expression. Western blot and immunohistochemistry assessed P2X7 and p-ERK protein expression in dorsal root ganglia (DRG). P2X7 antagonist A-438079 was also used to validate the involvement of P2X7 in acupuncture-mediated effects. Mind-regulating and pain-relieving acupuncture significantly improved locomotion, sucrose preference, and pain threshold compared to the model group (P < 0.01), while non-acupoint and agonist treatments showed no significant benefits. Acupuncture increased ATP levels and decreased IL-6 and TNF-α levels in DRG tissues (P < 0.01). P2X7 and p-ERK expression were elevated in the model group and suppressed following acupuncture, as confirmed by qPCR, Western blot, and immunohistochemistry. The P2X7 agonist reversed many of acupuncture's beneficial effects, indicating a role of the P2X7/ERK signaling pathway. Notably, co-administration of the P2X7 selective antagonist A-438079 counteracted the detrimental effects of BzATP and restored behavioral and biochemical outcomes to acupuncture-treated levels. Mind-regulating and pain-relieving acupuncture alleviates postoperative pain and reduces depressive-like behavior and locomotor impairments in a rat model of mixed hemorrhoids, likely through suppression of peripheral P2X7/ERK signaling and inflammation. These findings highlight P2X7 as a therapeutic target in postoperative pain and underscore the translational relevance of P2X receptors.