While comorbidity between coronary heart disease (CHD) and depression is evident, it is unclear whether the two diseases have shared underlying mechanisms. We performed a range of analyses in 367,703 unrelated middle-aged participants of European ancestry from UK Biobank, a population-based cohort study, to assess whether comorbidity is primarily due to genetic or environmental factors, and to test whether cardiovascular risk factors and CHD are likely to be causally related to depression using Mendelian randomization. We showed family history of heart disease was associated with a 20% increase in depression risk (95% confidence interval [CI] 16-24%, p < 0.0001), but a genetic risk score that is strongly associated with CHD risk was not associated with depression. An increase of 1 standard deviation in the CHD genetic risk score was associated with 71% higher CHD risk, but 1% higher depression risk (95% CI 0-3%; p = 0.11). Mendelian randomization analyses suggested that triglycerides, interleukin-6 (IL-6), and C-reactive protein (CRP) are likely causal risk factors for depression. The odds ratio for depression per standard deviation increase in genetically-predicted triglycerides was 1.18 (95% CI 1.09-1.27; p = 2 × 10-5); per unit increase in genetically-predicted log-transformed IL-6 was 0.74 (95% CI 0.62-0.89; p = 0.0012); and per unit increase in genetically-predicted log-transformed CRP was 1.18 (95% CI 1.07-1.29; p = 0.0009). Our analyses suggest that comorbidity between depression and CHD arises largely from shared environmental factors. IL-6, CRP and triglycerides are likely to be causally linked with depression, so could be targets for treatment and prevention of depression.