Background The aim was to estimate the impact of individual risk factors and treatment with various disease-modifying antirheumatic drugs (DMARDs) on the incidence of myocardial infarction (MI) in patients with rheumatoid arthritis (RA). Methods We analysed data from 11,285 patients with RA, enrolled in the prospective cohort study RABBIT, at the start of biologic (b) or conventional synthetic (cs) DMARDs. A nested case–control study was conducted, defining patients with MI during follow-up as cases. Cases were matched 1:1 to control patients based on age, sex, year of enrolment and five cardiovascular (CV) comorbidities. Generalized linear models were applied (Poisson regression with a random component, conditional logistic regression). Results In total, 112 patients developed an MI during follow-up. At baseline, during the first 6 months of follow-up and prior to the MI, inflammation markers (erythrocyte sedimentation rate (ESR) and C-reactive protein (CRP)) but not 28-joint-count disease activity score (DAS28) were significantly higher in MI cases compared to matched controls and the remaining cohort. Baseline treatment with DMARDs was similar across all groups. During follow-up bDMARD treatment was significantly more often discontinued or switched in MI cases. CV comorbidities were significantly less often treated in MI cases vs. matched controls (36 % vs. 17 %, p < 0.01). In the adjusted regression model, we found a strong association between higher CRP and MI (OR for log-transformed CRP at follow-up: 1.47, 95 % CI 1.00; 2.16). Furthermore, treatment with prednisone ≥10 mg/day (OR 1.93, 95 % CI 0.57; 5.85), TNF inhibitors (OR 0.91, 95 % CI 0.40; 2.10) or other bDMARDs (OR 0.85, 95 % CI 0.27; 2.72) was not associated with higher MI risk. Conclusions CRP was associated with risk of MI. Our results underline the importance of tight disease control taking not only global disease activity, but also CRP as an individual marker into account. It seems irrelevant with which class of (biologic or conventional) DMARD effective control of disease activity is achieved. However, in some patients the available treatment options were insufficient or insufficiently used - regarding DMARDs to treat RA as well as regarding the treatment of CV comorbidities.