Drinking coffee could protect against painful gallstones, scientists have claimed in a study. Consuming more than six cups of the drink per day was linked to a 23 percent lower risk of developing the condition where hard, pebble-like segments develop in the gallbladder, blocking the bile ducts. Drinking one cup per day was linked to a 3 percent cut in the risk.

Gallstones are generally made up of cholesterol and bilirubin, a pigment which occurs when red blood cells break down. The blobs are more common in those with obesity, and can cause pain in the upper right abdomen by leading to a build-up of bile in the gallbladder. Surgery is usually needed to treat the condition.  Coffee could be one tool to prevent the painful condition, the authors of the study published in the Journal of Internal Medicine said.

The research involved 114,220 participants in Denmark. Researchers collected information such as lifestyle choices, carried out physical examinations, and collected blood from which their DNA was extracted. Of the total, data was available on how much coffee 104,493 participants drank.

The team then looked at whether a genetic variant linked to metabolizing coffee was associated with drinking more coffee, and came up with what is known as an allele score. In the 114,220 participants, they assessed whether the genetic variants appeared to lower gallstone risk. Participants came from two cohorts assessed as one: the Copenhagen General Population Study (CGPS) and the Copenhagen City Heart Study (CCHS).

The authors wrote: “In both observational and genetic analyses, high coffee intake was associated with low risk of symptomatic GSD [symptomatic gallstone disease] in the general population. These results suggest that high coffee intake is likely to causally protect against symptomatic GSD.”

As the study was observational, it was not clear why coffee appears to impact the risk. But the authors suggested it could be down to a number of reasons, including the body using bile to excrete caffeine. This in turn could lower cholesterol levels in the bile by increasing flow of the substance. 

Earlier this year, coffee-drinkers received more arguably good news when a study concluded it doesn’t affect a person’s risk of developing cancer. Past studies suggested drinking coffee could reduce the risk of developing the disease.

Researchers looked at data on 316,497 people taking part in the U.K. Biobank (UKB) study. The participants told researchers how much coffee they drank each day. 

“Taken together, coffee intake is not associated with overall risk of being diagnosed with or dying from cancer in UKB,” they wrote in the International Journal of Epidemiology.