A bidirectional association between type 2 diabetes (T2DM) and depression has been consistently reported. Depression is associated with worse biomedical outcomes and increased mortality. The mechanisms underlying the association of T2DM with depression remain unclear. One possible question we can address is the extent to which the co-occurrence of diabetes and depression is due to correlated genetic and/or environmental risk factors. In this study, we performed structural equation model fitting to population-level data from the Swedish (n=68 606) and Danish (n=95 403) twin registries. The primary outcomes were clinical diagnosis of T2DM and depression using national hospital discharge registries. The phenotypic correlation between T2DM and depression is modest in both samples. In the Swedish sample, unique environmental effects explain a greater proportion of the covariance in males, whereas the association is primarily attributed to genetic effects in females. In the Danish sample, genetic effects account for the majority of the covariance in both males and females. Qualitative genetic sex differences are observed in both samples. We believe this is the first study to demonstrate significant genetic overlap between T2DM and depression.