OBJECTIVE Recent research demonstrating concurrent associations between mental disorders and peptic ulcers has renewed interest in links between psychological factors and ulcers. However, little is known about associations between temporally prior mental disorders and subsequent ulcer onset. Nor has the potentially confounding role of childhood adversities been explored. The objective of this study was to examine associations between a wide range of temporally prior DSM-IV mental disorders and subsequent onset of ulcer, without and with adjustment for mental disorder comorbidity and childhood adversities. METHODS Face-to-face household surveys conducted in 19 countries (n=52,095; person years=2,096,486). The Composite International Diagnostic Interview retrospectively assessed lifetime prevalence and age at onset of 16 DSM-IV mental disorders. Peptic ulcer onset was assessed in the same interview by self-report of physician's diagnosis and year of diagnosis. Survival analyses estimated associations between first onset of mental disorders and subsequent ulcer onset. RESULTS After comorbidity and sociodemographic adjustment, depression, social phobia, specific phobia, post-traumatic stress disorder, intermittent explosive disorder, alcohol and drug abuse disorders were significantly associated with ulcer onset (ORs 1.3-1.6). Increasing number of lifetime mental disorders was associated with ulcer onset in a dose-response fashion. These associations were only slightly attenuated by adjustment for childhood adversities. CONCLUSIONS A wide range of mental disorders were linked with the self-report of subsequent peptic ulcer onset. These associations require confirmation in prospective designs, but are suggestive of a role for mental disorders in contributing to ulcer vulnerability, possibly through abnormalities in the physiological stress response associated with mental disorders.