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 e-mails.
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, Janszky 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.
They underwent a health examination three months after discharge, and were monitored for eight years after that. The incidence of fatal heart attacks correlated inversely with the amount of chocolate consumed.
"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.
So should we all be loading up on cocoa-rich sweets?
"To be frank, I'm pretty cautious about chocolate because we're working on weight problems with so many individuals," said Mukamal, who is also a practising physician.
"However, I do encourage those who are looking for healthier desserts to consider chocolate in small quantities," he said.
"For individuals with no weight issues who have been able to eat chocolate in moderation and remain slim, I do not limit it," he added.
The researchers caution that clinical trials are needed to back up the findings of their study.
In the meantime, however, a bit of chocolate may not be amiss, they suggest.