Chronic pain (CP) is a leading cause of disability worldwide with complex aetiologies that remain elusive. Here we addressed this issue by performing a GWAS on a large UK Biobank sample (N=188,352 cases & N=69,627 controls) which identified two independent loci associated with CP near ADAMTS6 and LEMD2. Gene-based tests revealed additional CP-associated genes (DCAKD, NMT1, MLN, IP6K3). Across 1328 complex traits, 548 (41%) were genetically correlated with CP, of which 175 (13%) showed genetic causal relationships using the latent causal variable approach and Mendelian randomization. In particular, major depressive disorder, anxiety, smoking, body fat & BMI were found to increase the risk of CP, whereas diet, walking for pleasure & higher educational attainment were associated with a reduced risk (i.e., protective effect). This data-driven hypothesis-free approach has uncovered several specific risk factors that warrant further examination in longitudinal trials to help deliver effective early screening & management strategies for CP.