Smaller quantities confer less protection, but are still better than none, according to the study, which appears in the September issue of the Journal of Internal Medicine.
Earlier research had established a strong link between cocoa-based confections and lowered blood pressure or improvement in blood flow.
It had also shown that chocolate cuts the rate of heart-related mortality in healthy older men, along with post-menopausal women.
But the new study, led by Imre Janszky of the Karolinska Institute in Stockholm, is the first to demonstrate that consuming chocolate can help ward off the grim reaper if one has suffered acute myocardial infarction -- otherwise known as a heart attack.
"It was specific to chocolate -- we found no benefit to sweets in general," said Kenneth Mukamal, a researcher at Beth Israel Deaconess Medical Center in Boston and a co-author of the study.
"It seems that antioxidants in cocoa are a likely candidate" for explaining the live-saving properties, he told AFP in an exchange of emails.
Antioxidants are compounds that protect against so-called free radicals, molecules which accumulate in the body over time that can damage cells and are thought to play a role in heart disease, cancer and the aging process.
In the study, Janszsky and colleagues tracked 1,169 non-diabetic men and women, 45-to-70 years old, in Stockholm County during the early 1990s from the time they were hospitalised with their first-ever heart attack.
The participants were queried before leaving hospital on their food consumption habits over the previous year, including how much chocolate they ate on a regular basis.
"Our findings support increasing evidence that chocolate is a rich source of beneficial bioactive compounds," the researchers concluded.
The results held true for men and women, and across all the age groups included in the study.
Other factors that might have affected the outcome -- alcohol consumption, obesity, smoking -- were also taken into account.