This study aimed to investigate the role of 5-hydroxytryptamine 1A (5-HT1A) receptors in the anterior cingulate cortex (ACC) in regulating the affective pain in rats. In the ACC, normal saline (NS), the 5-HT1A receptor agonist 8-OH-DPAT or the 5-HT1A receptor antagonist WAY-100635 was pre-injected respectively. A persistent inflammatory pain model was established by subcutaneously injecting 0.08 mL of complete Freund's adjuvant (CFA) into the left hind paw of rats, which was then paired with a specific environment to induce a conditioned place avoidance (CPA) response. Then the electroacupuncture (EA, 10 Hz, 3 mA) was applied to stimulate the Huantiao acupoint (GB30). The CPA responses of rats in the pain-paired environment and the firing activities of ACC neurons were simultaneously observed. Subsequently, open-field behavior, paw withdrawal latency (PWL), and 50% paw withdrawal threshold (PWT) tests were conducted. The results showed that: (1) Rats injected with CFA showed significant reductions in PWL and 50% PWT, and spent less time in the "pain-paired environment" and the center of the open field, compared to the control group (P < 0.05). (2) Immunofluorescence double-labeling results showed a high co-expression of Fos protein and 5-HT1A receptors in the ACC of the EA-treated normal rats. (3) Pre-treatment with the 5-HT1A receptor agonist 8-OH-DPAT (8 μg) in the ACC alleviated CFA-induced affective pain (P < 0.05) and reversed the increase in firing frequency of pyramidal neurons in the ACC induced by CFA (P < 0.05). (4) Pre-treatment with the 5-HT1A receptor antagonist WAY-100635 (8 μg) in the ACC, combined with EA stimulation, reversed the CPA-like behavioral responses induced by CFA in rats and increased the firing frequency of pyramidal neurons in the ACC (P < 0.05). These results suggest that the 5-HT1A receptors in ACC mediate the alleviating effect of EA on the affective pain of CFA-induced rats.