Coffee has a ton of health benefits. But you may only experience the full perks if you're over 45 years old, a new study suggests.

»RELATED: Cups of coffee could help you live longer

Researchers from the Hospital de Navarra in Spain, recently conducted an experiment, which they presented at European Society of Cardiology Congress, to determine the link between coffee and mortality risk.

To do so, they gathered health statistics and food-frequency surveys from nearly 20,000 university graduates. They also factored in controlled factors such as gender, smoking status, and sugar intake and followed these individuals for about 10 years.

After analyzing the data, they found that those who drank four cups of coffee a day had a 64 percent lower risk of dying compared to those who rarely or never drank the beverage.

But the association between coffee and lower mortality risk was strongest among those who were over 45. They concluded that those 45 and older who drank two additional cups of joe a day had a 30 percent lower risk of mortality.

»RELATED: 8 things you never knew about coffee

"We found an inverse association between drinking coffee and the risk of all-cause mortality, particularly in people aged 45 years and above," researcher Adela Navarro said in a statement. "This may be due to a stronger protective association among older participants."

Researchers noted that this link was not significant among younger participants and that gender, smoking status and sugar intake did not affect the outcome.

While more studies need to be held to solidify their results, Navarro said, “our findings suggest that drinking four cups of coffee each day can be part of a healthy diet in healthy people.”

»RELATED: Cute cafes, coffee shops in metro Atlanta