OBJECTIVE: To evaluate the effectiveness of cognitive behavioral therapy for insomnia during pregnancy. METHODS: Randomized, unmasked, 3-site controlled trial. Participants were randomly allocated to cognitive behavioral therapy for insomnia (a first-line, empirically supported psychosocial intervention that addresses sleep-related behaviors and cognitions) or a control intervention consisting of imagery exercises that paired patient-identified distressing nighttime experiences with patient-identified neutral images. Participants were eligible if they met diagnostic criteria for insomnia disorder and were between 18 and 32 weeks of gestation. Patients were ineligible if they met diagnostic criteria for major psychiatric disorders, including depression, or were receiving nonstudy treatments that could affect sleep (or both). The primary outcome was the Insomnia Severity Index score, a validated brief questionnaire, with scores between 14 and 21 representing clinically meaningful insomnia of moderate severity, scores higher than 21 representing severe insomnia, and scores less than 8 representing no insomnia. Secondary outcomes included remission of insomnia (Insomnia Severity Index score less than 8), objectively measured and self-reported time awake (ie, total wake time), and the Edinburgh Postnatal Depression Scale score. All outcomes were measured weekly. Analysis included 48 participants who did not complete treatment. We estimated that 184 women would be required to have 80% power, with a two-tailed test, to detect a moderate Cohen's d effect size (.5) with α=.05. RESULTS: Between May 2013 and April 2017, 194 pregnant women were randomized and 149 completed treatment; 179 with available baseline data (92%) were ultimately analyzed, 89 in the cognitive therapy group and 90 in the control group. Women assigned to cognitive behavioral therapy for insomnia experienced significantly greater reductions in insomnia severity (scores decreased from 15.4±4.3 to 8.0±5.2 in the cognitive behavioral therapy group vs from 15.9±4.4 to 11.2±4.9 in the control therapy group [P<.001, d=0.5]). Remission of insomnia (to an Insomnia Severity Index score less than 8) disorder was attained by 64% of women in the cognitive behavioral therapy for insomnia group vs 52% in the control group. Women receiving cognitive behavioral therapy for insomnia experienced faster remission of insomnia disorder, with a median of 31 days vs 48 days in the control therapy (P<.001). Cognitive behavioral therapy for insomnia led to significantly greater reduction in self-reported but not objective total wake time and a small but significantly greater decline in Edinburgh Postnatal Depression Scale scores vs the control group. CONCLUSION: Cognitive behavioral therapy for insomnia is an effective nonpharmacologic treatment for insomnia during pregnancy. CLINICAL TRIAL REGISTRATION: ClinicalTrials.gov, NCT01846585.