Background There is limited evidence suggesting that osteoporosis might exacerbate depressive symptoms, while more studies demonstrate that depression negatively affects bone density and increases fracture risk.Aims To explore the relationship between major depressive disorder (MDD) and fracture risk.Methods We conducted a nested case-control analysis (32 670 patients with fracture and 397 017 individuals without fracture) and a matched cohort analysis (16 496 patients with MDD and 435 492 individuals without MDD) in the same prospective UK Biobank data set. Further, we investigated the shared genetic architecture between MDD and fracture with linkage disequilibrium score regression and the MiXeR statistical tools. We used the conditional/conjunctional false discovery rate approach to identify the specific shared loci. We calculated the weighted genetic risk score for individuals in the UK Biobank and logistic regression was used to confirm the association observed in the prospective study.Results We found that MDD was associated with a 14% increase in fracture risk (hazard ratio (HR) 1.14, 95% CI 1.14 to 1.15, p