Background Insomnia increases the likelihood of developing a mood or anxiety disorder. Moreover, symptoms of anxiety and depression, such as worry and rumination, contribute to insomnia. Given these relationships, there is a need to delineate how these disorders respond to treatment when they are comorbid. Methods 266 individuals presenting for anxiety and/or depression symptoms participated in this study in which symptoms of insomnia, anxiety, depression, disability, and sleep length were assessed. 102 of these patients were treated with internet-based cognitive behavioral therapy (iCBT) for anxiety and/or depression and 61 completed the treatment. Pre- to post-treatment symptom changes were examined in this subset. Results Insomnia, as measured by the Insomnia Severity Index, was evident in 40% of the patients. Individuals with insomnia reported more severe symptoms of anxiety and depression than individuals without insomnia. iCBT focused on anxiety and/or depression was associated with reductions in symptoms of insomnia, anxiety, depression, and disability. Total sleep time did not change over treatment. Limitations As the data were collected in routine care, there was no control group and no longer term follow-up assessment. Conclusions These findings highlight the importance of insomnia across anxiety and depressive disorders. They further demonstrate that treatment for anxiety and/or depression appears to improve comorbid insomnia symptoms, though may be ineffective in changing sleep duration.