Humans are social animals that experience intense suffering when they perceive a lack of social connection. Modern societies are experiencing an epidemic of loneliness. While the experience of loneliness is universally human, some people report experiencing greater loneliness than others. Loneliness is more strongly associated with mortality than obesity, emphasizing the need to understand the nature of the relationship between loneliness and health. While it is intuitive that circumstantial factors such as marital status and age influence loneliness, there is also compelling evidence of a genetic predisposition towards loneliness. To better understand the genetic architecture of loneliness and its relationship with associated outcomes, we extended the genome-wide association study (GWAS) meta-analysis of loneliness to 511 280 subjects, and detect 19 significant genetic variants from 16 loci, including four novel loci, as well as 58 significantly associated genes. We investigated the genetic overlap with a wide range of physical and mental health traits by computing genetic correlations and by building loneliness polygenic scores in an independent sample of 18 498 individuals with electronic health record data to conduct a PheWAS with. A genetic predisposition towards loneliness was associated with cardiovascular, psychiatric, and metabolic disorders, and triglycerides and high-density lipoproteins. Mendelian randomization analyses showed evidence of a causal, increasing, effect of both BMI and body fat on loneliness. Our results provide a framework for future studies of the genetic basis of loneliness and its relationship to mental and physical health.