Aim 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. Material and Methods 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. Results 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 Conclusions Sleep disturbance may increase the risk for CPIP, and contribute to maintenance of postsurgical pain. Females are at heightened risk for CPIP as compared to males. Given the robust associations between sleep disturbance and CPIP, interventions which consolidate and promote sleep, especially in females, may improve long-term pain control.