Dysmenorrhea is a common chronic pelvic pain syndrome affecting women of childbearing potential. Family studies suggest that genetic background influences the severity of dysmenorrhea, but genetic predisposition and molecular mechanisms underlying dysmenorrhea are not understood. In this study, we conduct the first genome-wide association study to identify genetic factors associated with dysmenorrhea pain severity. A cohort of females of European descent (n = 11,891) aged 18 to 45 years rated their average dysmenorrhea pain severity. We used a linear regression model adjusting for age and body mass index, identifying one genome-wide significant (P < 5 × 10) association (rs7523086, P = 4.1 × 10, effect size 0.1 [95% confidence interval, 0.074-0.126]). This single nucleotide polymorphism is colocalising with NGF, encoding nerve growth factor. The presence of one risk allele corresponds to a predicted 0.1-point increase in pain intensity on a 4-point ordinal pain scale. The putative effects on NGF function and/or expression remain unknown. However, genetic variation colocalises with active epigenetic marks in fat and ovary tissues, and expression levels in aorta tissue of a noncoding RNA flanking NGF correlate. Participants reporting extreme dysmenorrhea pain were more likely to report being positive for endometriosis, polycystic ovarian syndrome, depression, and other psychiatric disorders. Our results indicate that dysmenorrhea pain severity is partly genetically determined. NGF already has an established role in chronic pain disorders, and our findings suggest that NGF may be an important mediator for gynaecological/pelvic pain in the viscera.