Little research is available on the relationship between statin use and pyogenic liver abscess. The objective of the study was to determine whether prior use of statins is associated with pyogenic liver abscess. This case-control study was conducted to analyse the claim data of the Taiwan National Health Insurance Program. There were 1828 participants aged 20-84 years with first episode of pyogenic liver abscess from 2000 to 2013 as the cases and 1828 randomly selected participants without pyogenic liver abscess matched with sex, age and index year as the controls. Statin use was defined as 'current', 'recent' or 'past' if the statin prescription was filled ≤3 months, 3-6 months or >6 months before the date of pyogenic liver abscess diagnosis, respectively. Relative risk of pyogenic liver abscess associated with statin use was estimated by the odds ratio (OR) with 95% confidence interval (CI) using the multivariable logistic regression model. After controlling for potential confounders, the adjusted ORs of pyogenic liver abscess were 0.65 for participants with current use of statins (95% CI 0.50, 0.84), 0.74 for participants with recent use of statins (95% CI 0.49, 1.11), and 1.10 for participants with past use of statins (95% CI 0.90, 1.34), compared with participants with never use of statins. In the further analysis, the adjusted ORs of pyogenic liver abscess were 0.65 for participants with cumulative duration of statin use ≥12 months (95% CI 0.48, 0.88) and 0.68 for participants with cumulative duration of statin use <12 months (95% CI 0.43, 1.07), compared with participants with never use of statins. Our findings provide strong evidence that patients with current use of statins are associated with a 35% reduced odds of pyogenic liver abscess. The protective effect is stronger for longer duration of statin use.