ObjectivesPrimary insomnia is a substantial public health burden, but current treatments for this disorder have limited effectiveness and adherence. Herein, we aimed to investigate the efficacy and safety of continuous theta burst stimulation (cTBS) for the treatment of primary insomnia. MethodsThis two-armed, randomized, sham-controlled trial was conducted at Peking University Sixth Hospital and local community clinics. A total of 46 patients with primary insomnia were recruited and randomly allocated to either the cTBS group or sham group. Forty-one patients completed 10 sessions of cTBS or sham intervention and follow-up assessments. ResultsAfter the intervention, the severity of insomnia was significantly lower in the cTBS group than in the sham group, with a large effect size (Cohen's d = −1.938). Additionally, 52.4 % of patients in the cTBS group achieved a response (Insomnia Severity Index score reduction ≥8), whereas only 4 % of patients in the sham group achieved a response. The duration of objective total sleep time and slow-wave sleep were higher in the cTBS group than in the sham group. The degree of anxiety was lower in the cTBS group than in the sham group. There were no significant differences in depression, sleepiness, or cognitive function between the cTBS and sham groups. During follow-up, the sleep quality of the cTBS group significantly improved and remained stable at the 6-month follow-up. ConclusionIn this randomized clinical trial, cTBS improved insomnia symptoms and was generally well tolerated, thus supporting the further development of cTBS for the treatment of primary insomnia.