For men the association was not as strong but there was still a trend toward reduced heart deaths for coffee drinkers.
Decaf appeared to offer the same benefits.
Doctors say coffee may lower inflammation, but people should not start drinking it because of this research.
This study is published in the Annals of Internal Medicine.