Cholestasis is a common complication of hepatitis B virus (HBV) infection, characterized by increased intrahepatic and plasma bile acid levels. Cholestasis was found negatively associated with hepatitis outcome, however, the exact mechanism by which cholestasis impacts anti-viral immunity and impedes HBV clearance remains elusive. Here, we found that cholestatic mice are featured with dysfunctional T cells response, as indicated by decreased sub-population of CD25 + /CD69 + CD4 + and CD8 + cells, while CTLA-4 + CD4 + and CD8 + subsets were increased. Mechanistically, bile acids disrupt intracellular calcium homeostasis via inhibiting mitochondria calcium uptake and elevating cytoplasmic Ca 2+ concentration, leading to STIM1 and ORAI1 decoupling and impaired store-operated Ca 2+ entry which is essential for NFAT signaling and T cells activation. Moreover, in a transgenic mouse model of HBV infection, we confirmed that cholestasis compromised both CD4 + and CD8 + T cells activation resulting in poor viral clearance. Collectively, our results suggest that bile acids play pivotal roles in anti-HBV infection via controlling T cells activation and metabolism and that targeting the regulation of bile acids may be a therapeutic strategy for hostvirus defense.