People who drank one cup of coffee per day or less were four times more likely to suffer a heart attack than habitual coffee drinkers, found the study led by researchers from Harvard School of Public Health and the University of Washington.
They surveyed 500 Costa Ricans who had survived heart attacks, noting down coffee-drinking and lifestyle habits in the hours before the attack.
Debate over the potential health merits and dangers of coffee has risen over the last year thanks to a spate of new studies.
The Costa Rica survey found that a lack of exercise would make a cup of coffee more likely to trigger a heart attack, and that most of the danger was in the hour after consumption - dubbed 'the hazard period'. Risk returned to normal levels two or three hours after coffee intake.
Coffee consumption has risen rapidly across the UK and US especially in recent years. Americans now drink 3.2 cups per day on average, while Britain's coffee market last year overtook that for standard tea - long considered a 'national drink'.
The researchers believe that caffeine, as a recognised stimulant, may rapidly increase nervous system activity, which could then trigger a heart attack.
They suggested heavy coffee drinkers, on more than four cups per day, and consumers exercising regularly were less at risk because their bodies would be more used to coping with changes in the nervous system.
"It is possible that habitual coffee consumption results in tolerance that alters the acute physiological response to intake of coffee," said the scientists, who have published their work in the Epidemiology journal.
The study concedes that lifestyle factors may also play a part in heart disease risk. It notes that factors such as sex, war, marijuana, air pollution and eating habits could all play a part. The peak time for a heart attack is also thought to be first thing in the morning.
Heart health problems are one of the biggest killers in developed countries like the US, UK and France.
The Costa Rica research comes only four months after other Harvard researchers said there was no evidence that caffeine increased risk of coronary heart attacks. The researchers used data from the 44,005 men of the Health Professionals follow-up study, started in 1986, and the 84,488 women in the Nurses' Health Study, started in 1976.
Other studies have linked moderate coffee consumption to certain health benefits, such as lower risk of diabetes and protection against liver disease.
Another study published in the US last November suggested decaffeinated coffee may carry higher heart disease risks by increasing harmful LDL cholesterol in consumers' arteries. Thin people were more likely to have problems, the study found.
Official advice from the American Heart Association says one or two cups of coffee per day does not seem to be harmful.