The selective cyclooxygenase-2 (COX-2) inhibitors and other nonselective nonsteroidal antiinflammatory drugs (NSAIDs) have been associated with increased cardiovascular risk, but the risk in patients with established cardiovascular disease is unknown. In the present study, we analyzed the risk of rehospitalization for acute myocardial infarction (re-MI) and death related to the use of NSAIDs including selective COX-2 inhibitors in patients with a prior myocardial infarction (MI). We included 58,432 patients discharged alive after a first MI, and subsequent use of all NSAIDs was identified from a nationwide register of drug dispensing from pharmacies. We found a dose-dependent increase in risk of death for both the selective COX-2 inhibitors and the nonselective NSAIDs (all of the drugs tested). There were trends for increased risk of re-MI associated with the use of both the selective COX-2 inhibitors and the nonselective NSAIDs (high dosages). Selective COX-2 inhibitors in all dosages and nonselective NSAIDs in high dosages should be used with particular caution in patients with a prior MI.