To estimate the prevalence of residual pain 2 to 3 years after hernia surgery, to identify factors associated with its occurrence, and to assess the consequences for the patient. Iatrogenic chronic pain is a neglected problem that may totally annul the benefits from hernia repair. From the population-based Swedish Hernia Register 3000 patients aged 15 to 85 years were sampled from the 9280 patients registered as having undergone a primary groin hernia operation in the year 2000. Of these, the 2853 patients still alive in 2003 were requested to fill in a postal questionnaire. After 2 reminders, 2456 patients (86%), 2299 men and 157 women responded. In response to a question about "worst perceived pain last week," 758 patients (31%) reported pain to some extent. In 144 cases (6%), the pain interfered with daily activities. Age below median, a high level of pain before the operation, and occurrence of any postoperative complication were found to significantly and independently predict long-term pain in multivariate logistic analysis when "worst pain last week" was used as outcome variable. The same variables, along with a repair technique using anterior approach, were found to predict long-term pain with "pain right now" as outcome variable. Pain that is at least partly disabling appears to occur more often than recurrences. The prevalence of long-term pain can be reduced by preventing postoperative complications. The impact of repair technique on the risk of long-term pain shown in our study should be further assessed in randomized controlled trials.