The five-year global study collected data from almost 32,000 people in 40 countries.
Participants with heart disease were asked how often they consumed milk, vegetables, fruits, grains, fish, nuts, meat and poultry.
They were also questioned about lifestyle choices such as smoking, alcohol consumption and exercise.
A healthy diet was defined as one including a high intake of fruits, vegetables, whole grains and nuts, with more fish than meat, poultry or eggs.
Eating healthily was associated with a 14pc reduction in the risk of new heart attacks and a 19pc reduction in the risk of stroke.
The risk of dying from heart disease was reduced by 35pc and of developing congestive heart failure by 28pc.
The findings appear online in the American Heart Association Rapid Access Journal.
Study leader Dr Mahshid Dehglan, from McMaster University in Canada, said: "At times, patients don't think they need to follow a healthy diet since their medications have already lowered their blood pressure and cholesterol -- that is wrong.
"Dietary modification has benefits in addition to those seen with aspirin, angiotensin modulators, lipid-lowering agents and beta blockers.
"Physicians should advise their high-risk patients to improve their diet and eat more vegetables, fruits, grains and fish.
"This could substantially reduce cardiovascular recurrence beyond drug therapy alone and save lives globally."
Despite differing food habits, a healthy diet was associated with prevention of recurrent heart disease throughout the world in both rich and poor countries.