Background Whether nucleoside reverse transcriptase inhibitors increase the risk of myocardial infarction in HIV-infected individuals is unclear. Our aim was to explore whether exposure to such drugs was associated with an excess risk of myocardial infarction in a large, prospective observational cohort of HIV-infected patients. Methods We used Poisson regression models to quantify the relation between cumulative, recent (currently or within the preceding 6 months), and past use of zidovudine, didanosine, stavudine, lamivudine, and abacavir and development of myocardial infarction in 33 347 patients enrolled in the D:A:D study. We adjusted for cardiovascular risk factors that are unlikely to be aff ected by antiretroviral therapy, cohort, calendar year, and use of other antiretrovirals. Findings Over 157 912 person-years, 517 patients had a myocardial infarction. We found no associations between the rate of myocardial infarction and cumulative or recent use of zidovudine, stavudine, or lamivudine. By contrast, recent-but not cumulative-use of abacavir or didanosine was associated with an increased rate of myocardial infarction (compared with those with no recent use of the drugs, relative rate 1·90, 95% CI 1·47-2·45 [p=0·0001] with abacavir and 1·49, 1·14-1·95 [p=0·003] with didanosine); rates were not signifi cantly increased in those who stopped these drugs more than 6 months previously compared with those who had never received these drugs. After adjustment for predicted 10-year risk of coronary heart disease, recent use of both didanosine and abacavir remained associated with increased rates of myocardial infarction (1·49, 1·14-1·95 [p=0·004] with didanosine; 1·89, 1·47-2·45 [p=0·0001] with abacavir). Interpretation There exists an increased risk of myocardial infarction in patients exposed to abacavir and didanosine within the preceding 6 months. The excess risk does not seem to be explained by underlying established cardiovascular risk factors and was not present beyond 6 months after drug cessation.