Insomnia predicts the onset of depression, commonly co-presents with depression and often persists following depression remission. However, these conditions can be challenging to treat concurrently using depression-specific therapies. Cognitive behavioural therapy for insomnia may be an appropriate treatment to improve both insomnia and depressive symptoms. We examined the effects of a fully-automated digital cognitive behavioural therapy intervention for insomnia (Sleepio) on insomnia and depressive symptoms, and the mediating role of sleep improvement on depressive symptoms in participants from two randomized controlled trials of digital cognitive behavioural therapy for insomnia. We also explored potential moderators of intervention effects. All participants met criteria for probable insomnia disorder and had clinically significant depressive symptomatology (PHQ-9 ≥ 10; n = 3,352). Individuals allocated to treatment in both trials were provided access to digital cognitive behavioural therapy. Digital cognitive behavioural therapy significantly improved insomnia (p < .001; g = 0.76) and depressive symptoms (p < .001; g = 0.48) at post-intervention (weeks 8-10), and increased the odds (OR = 2.9; 95% CI = 2.34, 3.65) of clinically significant improvement in depressive symptoms (PHQ-9 < 10). Improvements in insomnia symptoms at mid-intervention mediated 87% of the effects on depressive symptoms at post-intervention. No variables moderated effectiveness outcomes, suggesting generalizability of these findings. Our results suggest that effects of digital cognitive behavioural therapy for insomnia extend to depressive symptoms in those with clinically significant depressive symptomatology. Insomnia may, therefore, be an important therapeutic target to assist management of depressive symptoms.© 2020 The Authors. Journal of Sleep Research published by John Wiley & Sons Ltd on behalf of European Sleep Research Society.