Biliary tract cancers are relatively rare but fatal tumors. Apart from a close link with gallstones and cholangitis, risk factors for biliary tract cancer are obscure. Chronic liver conditions, including liver cirrhosis, have been linked to a higher risk of biliary tract cancer. In a population-based case-control study conducted in Shanghai, China, we investigated the relationships of a history of chronic hepatitis and liver cirrhosis as well as a family history of liver cancer with biliary tract cancer risk. The study included 627 patients with biliary tract cancers (368 gallbladder, 191 bile duct and 68 ampulla of Vater), 1,037 patients with biliary stones (774 gallbladder stones and 263 bile duct stones) and 959 healthy subjects randomly selected from the population. Bile duct cancer was associated with self-reports of chronic liver conditions, including a history of chronic hepatitis (OR = 2.0, 95% CI 0.9–4.4), liver cirrhosis (OR = 4.7, 95% CI 1.9–11.7) and a family history of primary liver cancer (OR = 2.0, 95% CI 1.0–3.9). The excess risk persisted after adjustment for gallstones and were more pronounced among subjects without gallstones (OR = 5.0, 95% CI 1.3–20.0 and OR = 4.9, 95% 2.0–12.2, respectively). History of liver conditions was also associated with an excess of biliary stones (OR = 1.9, 95% CI 1.2–3.0). No association was found for cancers of the gallbladder and ampulla of Vater. A history of chronic hepatitis and cirrhosis may be risk factors for extraheptic bile duct cancer. Given that chronic infection with hepatitis B virus (HBV) is the most common cause of liver disease in China, serologic markers of HBV need to be measured in future studies to examine the link between HBV and bile duct cancer. © 2007 Wiley-Liss, Inc.