Cholestasis is characterized by hepatic accumulation of cytotoxic bile acids (BAs), which often subsequently leads to liver injury, inflammation, fibrosis, and liver cirrhosis. Fibroblast growth factor 21 (FGF21) is a liver-secreted hormone with pleiotropic effects on the homeostasis of glucose, lipid, and energy metabolism. However, whether hepatic FGF21 plays a role in cholestatic liver injury remains elusive. We found that serum and hepatic FGF21 levels were significantly increased in response to cholestatic liver injury. Hepatocyte-specific deletion of Fgf21 exacerbated hepatic accumulation of BAs, further accentuating liver injury. Consistently, administration of rFGF21 ameliorated cholestatic liver injury caused by α-naphthylisothiocyanate (ANIT) treatment and Mdr2 deficiency. Mechanically, FGF21 activated a hepatic FGFR4-JNK signaling pathway to decrease Cyp7a1 expression, thereby reducing hepatic BAs pool. Our study demonstrates that hepatic FGF21 functions as an adaptive stress-responsive signal to downregulate BA biosynthesis, thereby ameliorating cholestatic liver injury, and FGF21 analogs may represent a candidate therapy for cholestatic liver diseases.