Five or more daily portions should be enough to counteract culprit versions of a gene on chromosome 9, thought to be possessed by a fifth of people of European ancestry.
Healthy diets appeared to weaken its effect.
The US researchers investigated more than 27,000 people for their work.
The findings were published in Plos Medicine journal.
These participants came from around the globe, including Europe, China and Latin America.
The results suggest that individuals with high risk 9p21 gene versions who consumed a diet packed with raw vegetables, fruits and berries had a similar risk of heart attack as those with a low-risk variant of the same gene.
Foods that count:
- Fresh fruit and vegetables
- Frozen fruit and vegetables
- Dried fruit, such as currants, dates, sultanas and figs
- Tinned or canned fruit and vegetables
- Fruit and vegetables cooked in dishes such as soups, stews or pasta dishes
- A glass (150ml) of unsweetened 100% fruit or vegetable juice
- Beans and pulses; these only count as one portion a day, no matter how many you eat
According to National Diet and Nutrition Survey, Fewer than a third of adults and only one in 10 children are eating their recommended “five-a-day” of fruit and vegetables.
Researcher Prof Sonia Anand, of McMaster University, said: “Our results support the public health recommendation to consume more than five servings of fruits or vegetables as a way to promote good health.”
“The study findings suggest that lifestyle does matter, no matter what your genes have dealt you”, says Eric Topol, MD, professor of translational genomics at The Scripps Research Institute and director of the Scripps Translational Science Institute in La Jolla, California.”
The scientists, who also included staff from McGill University, say they now need to do more work to establish how diet might have this effect on genes.
Judy O’Sullivan of the British Heart Foundation said the findings should serve as a reminder that while lifestyle and genes could increase heart risk, the way the two interacted with each other was also very important.
“The relationship between the two is often very complicated and we don’t yet have all the answers, but the message appears to be very simple – eating lots of fruit and vegetables is great news for our heart health.”