Anxiety is a common comorbidity associated with chronic pain, which results in chronic pain complexification and difficulty in treatment. Electroacupuncture (EA) is commonly used to treat chronic pain and anxiety. However, the underlying mechanisms of the EA effect are largely unknown. Here, we showed that a circuitry underlying chronic pain induces anxiety disorders, and EA can treat them by regulating such circuitry. Using chemogenetic methods, we found that chemogenetic activation of the rostral anterior cingulate cortex (rACC) glutamatergic output to the thalamus induced anxiety disorders in control rats. Then, chemogenetic inhibition of the rACC-thalamus circuitry reduced anxiety-like behavior produced by intraplantar injection of the complete Freund’s adjuvant (CFA). In this study, we examined the effects of EA on a rat model of CFA-mediated anxiety-like behaviors and the related mechanisms. We found that chemogenetic activation of the rACC-thalamus circuitry effectively blocked the effects of EA on chronic pain-induced anxiety-like behaviors in CFA rats. These results demonstrate an underlying rACC-thalamus glutamatergic circuitry that regulates CFA-mediated anxiety-like behaviors. This study also provides a potential mechanistic explanation for EA treatment of anxiety caused by chronic pain.