BACKGROUND: Hepatic encephalopathy (HE) is a mental and neurological complication induced by acute or chronic hepatic failure. Emerging evidence indicates that the farnesoid X receptor (FXR), a multifunctional nuclear receptor and transcription factor, plays a pivotal role in regulating the expression of key genes associated with ammonia metabolism. However, the effect of FXR activation on HE has remained largely uncharted. METHODS: We established mouse models of HE by intraperitoneal injection of thioacetamide (TAA) and partial hepatectomy (PHx). Subsequently, we administered obeticholic acid (OCA) to activate FXR and investigated its effects on HE through comprehensive biochemical, biological, histological and behavioral analysis. Additionally, in vitro experiments were conducted to examine the impact of FXR activation on ammonia stress. FINDINGS: In the animal model of HE, activation of FXR upregulated the expression of key enzymes involved in ammonia metabolism pathway within the liver, thereby enhancing urea cycle functionality, reducing plasma ammonia levels, and mitigating liver injury. Furthermore, FXR activation significantly improved behavioral activities in mice and mitigated inflammation in the brain. Finally, our findings demonstrated that activating FXR could enhance ammonia metabolism and ammonia tolerance of C3A cells. INTERPRETATION: Our data provide novel evidence demonstrating that the activation of FXR by OCA exerts regulatory control over the expression of enzymes involved in ammonia metabolism, thereby effectively alleviating HE. Consequently, FXR could emerge as a promising novel target for HE treatment. FUNDING: This study was supported by the National Natural Science Foundation of China No: 81970726 (to W-D Chen), and Henan Provincial Key Project of Medical Science and Technology Research No: SBGJ202102215 (to WL Ye).