Background Chromosome 9p21 variants are associated with cardiovascular disease (CVD) but not with any of its known risk markers. However, recent studies have suggested that the risk associated with 9p21 variation is modified by a prudent dietary pattern and smoking. We tested if the increased risk of CVD by the 9p21 single nucleotide polymorphism rs4977574 is modified by intakes of vegetables, fruits, alcohol, or wine, and if rs4977574 interacts with environmental factors on known CVD risk markers. Methods Multivariable Cox regression analyses were performed in 23,949 individuals from the population-based prospective Malmö Diet and Cancer Study (MDCS), of whom 3,164 developed CVD during 15 years of follow-up. The rs4977574 variant (major allele: A; minor allele: G) was genotyped using TaqMan® Assay Design probes. Dietary data were collected at baseline using a modified diet history method. Cross-sectional analyses were performed in 4,828 MDCS participants with fasting blood levels of circulating risk factors measured at baseline. Results Each rs4977574 G allele was associated with a 16% increased incidence of CVD (95% confidence interval (CI), 1.10–1.22). Higher vegetable intake (hazard ratio (HR), 0.95 [CI: 0.91–0.996]), wine intake (HR, 0.91 [CI: 0.86–0.96]), and total alcohol consumption (HR, 0.92 [CI: 0.86–0.98]) were associated with lower CVD incidence. The increased CVD incidence by the G allele was restricted to individuals with medium or high vegetable intake (Pinteraction = 0.043), and to non- and low consumers of wine (Pinteraction = 0.029). Although rs4977574 did not associate with any known risk markers, stratification by vegetable intake and smoking suggested an interaction with rs4977574 on glycated hemoglobin and high-density lipoprotein cholesterol (Pinteraction = 0.015 and 0.049, respectively). Conclusions Our results indicate that rs4977574 interacts with vegetable and wine intake to affect the incidence of CVD, and suggest that an interaction may exist between environmental risk factors and rs4977574 on known risk markers of CVD. Electronic supplementary material The online version of this article (doi:10.1186/s12881-014-0138-x) contains supplementary material, which is available to authorized users.