People who drink more than a cup of coffee a day are less likely to get liver cancer than those who do not.
A team at Tohoku University in Sendai, Japan, compiled data on more than 60,000 adults.
Professor Ichiro Tsuji, who led the study, said the team was yet to pinpoint the substance in coffee which appeared to curb liver cancer.
However, he said coffee helped lower the risk of cirrhosis, and that chlorogenic acid, present in coffee beans, had proven in an animal study to reduce the risk of liver cancer.
The team studied 61,000 people, aged 40 years or over, for seven to nine years between 1984 and 1997.
"The tendency not to develop liver cancer among coffee drinkers was consistent even if we analyzed their age, sex and drinking habits," Tsuji said. "But putting too much sugar into coffee is not good for you."