To investigate the effect of acupuncture on the brain functional activities of the patients with primary dysmenorrhea based on the resting-state functional magnetic resonance imaging (rs-fMRI), and to provide visual evidence for the central mechanism of acupuncture in treatment of primary dysmenorrhea. Forty-two patients of primary dysmenorrhea were enrolled and randomly divided into an observation group (21 cases, 1 case dropped off) and a control group (21 cases, 2 cases dropped off, 3 cases withdrawal). In the observation group, acupuncture was exerted at Sanyinjiao (SP 6) and Guanyuan (CV 4), started 5-7 days before menstrual flow, once a day till menstrual onset, for a total of 3 menstrual cycles. No intervention was applied in the control group. The scores of visual analogue scale (VAS) and Cox menstrual symptom scale (CMSS) were observed in both groups before and after treatment. Based on rs-fMRI, the data of resting-state functional magnetic resonance were collected from two groups before and after treatment. Combined with functional connectivity strength (FCS) and functional connectivity (FC) analysis, the differences of brain regions before and after treatment were compared between the two groups and the correlation was analyzed between their functional connectivity changes and the improvements in VAS and CMSS scores of the patients in the observation group. In the observation group, the scores of VAS and CMSS were all decreased after treatment (P<0.05), while the scores related to the symptom time in CMSS was reduced in comparison with that before treatment in the control group (P<0.05). The score reducing ranges of VAS and CMSS in the observation group were larger than the control group (P<0.05). Compared before treatment, FCS of the right middle cingulate cortex and the left cuneus was increased, while FCS of the left inferior parietal lobule was decreased after treatment in the observation group. In the control group, FCS of the left orbital frontal cortex was increased after treatment. Compared with the control group, FCS of the left anterior insula was increased in the observation group after treatment. FC analysis was performed using the left anterior insula as the seed point. In comparison with the control group, FC of the left anterior insula was increased either with the inferior temporal gyrus or with the right hippocampus; and was decreased either with the middle occipital lobe or with the right dorsolateral prefrontal cortex in the observation group after treatment. In the observation group, FC between the left anterior insula and the right hippocampus was positively correlated with the improvements in symptom severity (r =0.385, P<0.05) and symptom time (r =0.510, P<0.05) of CMSS, and FC between the right dorsolateral prefrontal cortex and the left anterior insula was negatively correlated with the improvement in symptom severity of CMSS after treatment (r =-0.373, P<0.05). The anterior insula may be the key brain region in treatment of primary dysmenorrhea with acupuncture. Acupuncture may relieve dysmenorrhea and the related symptoms through strengthening the functional connectivity of anterior insula-limbic system and anterior insula-control network.