Abstract Objectives: Biliary tract cancers (BTCs) comprise the second most common type of hepatobiliary cancer. Given the increase in global BTC incidence, with associated morbidity and mortality, together with the limited therapeutic options, there is increasing interest in strategies for disease prevention. We performed a population-based cohort study to determine the association between low dose aspirin, non-aspirin NSAIDs, statins, metformin, other risk factors and the risk of biliary tract cancer (BTC), while assessing confounding by sex. Methods: We conducted a nationwide Swedish population-based cohort study using the Swedish Prescribed Drug Registry, which virtually completely enumerates use of prescribed medications nationwide since 2005. BTC diagnosis (intrahepatic cholangiocarcinoma [iCCA], extrahepatic cholangiocarcinoma [eCCA] or gallbladder cancer [GBC]) was ascertained from the Swedish Cancer Registry. Age-scaled Cox models, with exposure as time-varying covariates, were used to calculate hazard ratios (HRs), separately for men and women. Results: In the 5.7 million person cohort, the risk of iCCA was significantly lower in men using statins (HR 0.62,95%CI 0.39-1.00,p=0.05), with a non-significant reduction in women. Statin use was associated with a significantly decreased risk of eCCA in both women (HR 0.60,0.38-0.94,p=0.03) and men (HR 0.47,0.28-0.80,p=0.01). Low dose aspirin (HR 0.76,0.60-0.97,p=0.03) was associated with a lower risk of GBC only in women, while statins (HR 0.72,0.55-0.93,p=0.01) showed a significantly decreased risk of GBC in women and a non-significant reduction in men. For all BTC subtypes, combined use of low dose aspirin and statins did not confer additional risk reductions beyond those achieved by statins alone. Male and female users of non-aspirin NSAIDs appeared to be at increased risk of BTC and its subtypes. Metformin did not significantly affect risk of BTC. Conclusion: We performed the largest population-based cohort study evaluating risk and protective factors for BTC. Our results provide strong evidence in favor of the chemopreventive roles of low dose aspirin and statins in a subtype-and sex-specific manner. Individual risk factors contribute to development of BTC subtypes in different magnitudes. If randomized controlled clinical trials validate our findings and provide favorable evidence of the efficacy and safety of these drugs in the prevention of BTCs, our results could potentially be practice-changing, leading to improvements in the outcomes in this population. Citation Format: Lorena Marcano-Bonilla, Cathy D. Schleck, W. Scott Harmsen, Omid Sadr-Azodi, Mitesh J. Borad, Tushar Patel, Gloria M. Petersen, Terry M. Therneau, Lewis R. Roberts, Nele Brusselaers. Associations of aspirin, non-aspirin NSAIDs, statins, and metformin with risk of biliary tract cancer: A Swedish population-based cohort study [abstract]. In: Proceedings of the American Association for Cancer Research Annual Meeting 2019; 2019 Mar 29-Apr 3; Atlanta, GA. Philadelphia (PA): AACR; Cancer Res 2019;79(13 Suppl):Abstract nr 5049.