Cholesterol-reducing statins are a double-edged sword for people living with chronic viral hepatitis. Though the meds may impair liver function, a study published online in the Journal of Clinical Oncology concludes they may also reduce the risk of developing liver cancer in people with hepatitis B virus (HBV) infection.

For the study, researchers followed more than 33,000 people with hepatitis B from 1997 to 2008, during which time 1,021 participants developed liver cancer. Those participants who took statins to reduce cholesterol—common options include Lipitor, Pravachol, Zocor and Crestor—were less likely to develop liver cancer than those not taking statins. Moreover, taking statins for a longer period of time corresponded with a greater reduction in liver cancer risk.

“This is exciting and unequivocally solid research,” said Eugene Schiff, MD, director of the Center for Liver Diseases at the University of the Miami School of Medicine. While noting that statin use is relatively contraindicated for people with liver disease, Schiff said that “the take-home message for people with hepatitis B or anybody with liver disease is that statins are safe.”

Statins aren’t necessarily an ideal preventative for liver cancer, however. They can cause a potentially harmful increase in liver enzyme production—an important problem for those with reduced liver function, such as that induced by cirrhosis (liver scarring), a common precursor of liver cancer. As a result, people taking statins need to have their liver function tested regularly.

The researchers emphasized that more study is needed to discover the mechanism by which statins reduce the risk of liver cancer for people with hepatitis B.