Pain might be an important risk factor for common mental disorders. Insight into the longitudinal association between pain and common mental disorders in the general adult population could help improve prevention and treatment strategies. Data were used from the first 2 waves of the Netherlands Mental Health Survey and Incidence Study-2, a psychiatric epidemiological cohort study among the Dutch general population aged 18 to 64 years at baseline (N = 5303). Persons without a mental disorder 12 months before baseline were selected as the at-risk group (n = 4974 for any mood disorder; n = 4979 for any anxiety disorder; and n = 5073 for any substance use disorder). Pain severity and interference due to pain in the past month were measured at baseline using the Short Form Health Survey. DSM-IV mental disorders were assessed at both waves using the Composite International Diagnostic Interview version 3.0. Moderate to very severe pain was associated with a higher risk of mood (odds ratio [OR] = 2.10, 95% confidence interval [CI] = 1.33-3.29) or anxiety disorders (OR = 2.12, 95% CI = 1.27-3.55). Moderate to very severe interference due to pain was also associated with a higher risk of mood (OR = 2.14, 95% CI = 1.30-3.54) or anxiety disorders (OR = 1.92, 95% CI = 1.05-3.52). Pain was not significantly associated with substance use disorders. No interaction effects were found between pain severity or interference due to pain and a previous history of mental disorders. Moderate to severe pain and interference due to pain are strong risk factors for first-incident or recurrent mood and anxiety disorders, independent of other mental disorders. Pain management programs could therefore possibly also serve as a preventative program for mental disorders.