Background:Diabetes is considered a risk factor for myocardial infarction. However, we have previously found that diabetes was not a short-term risk factor for myocardial infarction in the absence of obstructive coronary artery disease.Methods:We conducted a cohort study of patients undergoing coronary angiography from 2003 to 2012 and followed them by cross-linking Danish health registries. Patients were stratified according to coronary artery disease and diabetes. Endpoints included myocardial infarction, cardiac death, all-cause death and coronary revascularization.Results:86,202 patients were included in total (diabetes: <i>n</i> = 12,652). Median follow-up was 8.8 years. Using patients with neither coronary artery disease nor diabetes as reference (cumulative myocardial infarction incidence 2.6%), the risk of myocardial infarction was low and not substantially increased for patients with diabetes alone (3.2%; hazard ratio 1.202, 95% confidence interval 0.996−1.451), was increased for patients with coronary artery disease alone (9.3%; hazard ratio 2.75, 95% confidence interval 2.52−3.01) and was highest for patients with both coronary artery disease and diabetes (12.3%; hazard ratio 3.79, 95% confidence interval 3.43−4.20). Similar associations were observed for cardiac death and coronary revascularization.Conclusion:Diabetes patients without coronary artery disease by coronary angiography have a low risk of myocardial infarction, not substantially increased compared to patients with neither coronary artery disease nor diabetes. In the presence of coronary artery disease, however, diabetes increases the risk of myocardial infarction.