To evaluate the risk of developing upper gastrointestinal (UGI) bleeding from nonsteroidal anti-inflammatory drugs (NSAIDs), a retrospective (historical) cohort study was performed, using a computerized data base including 1980 billing data from all Medicaid patients in the states of Michigan and Minnesota. Comparing 47,136 exposed patients to 44,634 unexposed patients, the unadjusted relative risk for developing UGI bleeding 30 days after exposure to a NSAID was 1.5 (95% confidence interval 1.2 to 2.0). Univariate analyses demonstrated associations between UGI bleeding and age, sex, state, alcohol-related diagnoses, preexisting abdominal conditions, and use of anticoagulants. This association between NSAIDs and UGI bleeding was unchanged after adjusting for these potential confounding variables using logistic regression. A linear dose-response relationship and a quadratic duration-response relationship were demonstrated. Non-steroidal anti-inflammatory drugs are associated with UGI bleeding, although the magnitude of the increased risk is reassuringly small.