Treatment with non-steroidal anti-inflammatory drugs (NSAIDs) is hampered by gastrointestinal ulcer complications, such as ulcer bleeding and perforation. The efficacy of proton-pump inhibitors in the primary prevention of ulcer complications arising from the use of NSAIDs remains unproven. Selective cyclooxygenase-2 (COX-2) inhibitors reduce the risk for ulcer complications, but not completely in high-risk patients. This study determines which patients are especially at risk for NSAID ulcer complications and investigates the effectiveness of different preventive strategies in daily clinical practice. With the use of a nested case-control design, a large cohort of NSAID users was followed for 26 months. Cases were patients with NSAID ulcer complications necessitating hospitalisation; matched controls were selected from the remaining cohort of NSAID users who did not have NSAID ulcer complications. During the observational period, 104 incident cases were identified from a cohort of 51,903 NSAID users with 10,402 patient years of NSAID exposure (incidence 1% per year of NSAID use, age at diagnosis 70.4 ± 16.7 years (mean ± SD), 55.8% women), and 284 matched controls. Cases were characterised by serious, especially cardiovascular, co-morbidity. In-hospital mortality associated with NSAID ulcer complications was 10.6% (incidence 21.2 per 100,000 NSAID users). Concomitant proton-pump inhibitors (but not selective COX-2 inhibitors) were associated with a reduced risk for NSAID ulcer complications (the adjusted odds ratio 0.33; 95% confidence interval 0.17 to 0.67; p = 0.002). Especially at risk for NSAID ulcer complications are elderly patients with cardiovascular co-morbidity. Proton-pump inhibitors are associated with a reduced risk for NSAID ulcer complications.