Red meat has been suggested to be adversely associated with risk of myocardial infarction (MI), whereas vegetable consumption has been found to be protective. The aim of this study was to investigate substitutions of red meat, poultry and fish with vegetables or potatoes for MI prevention. We followed up 29 142 women and 26 029 men in the Danish Diet, Cancer and Health study aged 50–64 years with no known history of MI at baseline. Diet was assessed by a validated 192-item FFQ at baseline. Adjusted Cox proportional hazard models were used to calculate hazard ratios (HR) and 95 % CI for MI associated with specified food substitutions of 150 g/week. During a median follow-up of 13·6 years, we identified 656 female and 1694 male cases. Among women, the HR for MI when replacing red meat with vegetables was 0·94 (95 % CI 0·90, 0·98). Replacing fatty fish with vegetables was associated with a higher risk of MI (HR 1·23; 95 % CI 1·05, 1·45), whereas an inverse, statistically non-significant association was found for lean fish (HR 0·93; 95 % CI 0·83, 1·05). Substituting poultry with vegetables was not associated with risk of MI (HR 1·00; 95 % CI 0·90, 1·11). Findings for substitution with potatoes were similar to findings for vegetables. Among men, a similar pattern was observed, but the associations were weak and mostly statistically non-significant. This study suggests that replacing red meat with vegetables or potatoes is associated with a lower risk of MI, whereas replacing fatty fish with vegetables or potatoes is associated with a higher risk of MI.