To observe the clinical effect of electroacupuncture (EA) on aged insomnia, and explore its possible mechanism. A total of 60 patients with aged insomnia were randomly divided into an EA group (30 cases) and a sham EA group (30 cases, 1 case dropped off). The patients in the EA group were treated with acupuncture at Baihui (GV 20), Yintang (GV 29), Shenmen (HT 7), Sanyinjiao (SP 6), Xinshu (BL 15) and Shenshu (BL 23), and EA was used at Baihui (GV 20) and Yintang (GV 29), with intermittent wave, 2 Hz in frequency. In the sham EA group, the acupoints and the EA connection acupoints were the same as those in the EA group, 2-3 mm in depth, but no current was connected. The intervention was given 30 min each time, once every other day, 3 times a week for 4 weeks in the both groups. Before and after treatment, the Pittsburgh sleep quality index (PSQI) and Montreal cognitive assessment (MoCA) scale were used to assess sleep quality and cognitive function, and serum melatonin (MT) and dopamine (DA) levels were detected. After treatment, the total score and sub-item scores of PSQI in the EA group were lower than those before treatment (P<0.01, P<0.05), among them, the sub-item scores of sleep quality, time to fall asleep, sleep time and sleep efficiency, daytime dysfunction and total score were all lower than those in the sham EA group (P<0.01, P<0.05). After treatment, the MoCA score and serum MT and DA levels in the EA group were higher than those before treatment (P<0.01), and the MoCA score and serum MT level in the EA group were higher than the sham EA group (P<0.01, P<0.05). Electroacupuncture can improve sleep quality and cognitive function in aged insomnia patients, and its mechanism may be related to regulating serum MT and DA levels.