Persistent pain after groin hernia repair is a major health problem. Sleep disturbance is associated with heightened pain sensitivity. The main objective of this study was to examine the role of sleep disturbance in the development and long-term maintenance of chronic postherniorrhaphy inguinal pain (CPIP), with exploration of sex differences. From 2012-2017, a national cohort of patients with prior groin hernia repair (n=2084;45.8% females) were assessed for the development of CPIP 12 months after surgery. Patients then underwent long-term (median 5.0 years) follow-up to evaluate the contribution of sex and sleep disturbance on the maintenance of CPIP. Associations between pre- and postoperative sleep problems (assessed at long-term follow-up) and CPIP were tested using logistic regression. Females had higher rates of CPIP with negative impact on daily activities 12 months after surgery as compared to males (14.6 vs 9.2%,p<0.0005), and were more likely to have moderate-severe CPIP in the long-term (3.1 vs 1.2%,p=0.003). Preoperative sleep problems predicted development of CPIP 12 months after surgery (adjusted odds ratio (aOR) 1.76 (95%CI 1.26-2.46),p=0.001) and CPIP in the long-term (aOR 2.20 (1.61-3.00),p<0.0001). CPIP was associated with insomnia and depression. Sleep disturbance may increase the risk for CPIP, and contribute to maintenance of postsurgical pain. PERSPECTIVE: Females are at heightened risk for CPIP as compared to males. Increased severity of pain symptoms are linked to poorer sleep and psychiatric morbidity. Given the robust associations between sleep disturbance and CPIP, interventions which consolidate and promote sleep, especially in females, may improve long-term pain control.