Liver failure may affect cerebral function, leading to hepatic encephalopathy (HE), a neuropsychiatric condition that may present different forms and grades of severity. Liver failure may be acute or chronic (for example, cirrhosis), and each condition induces different neurological alterations.Acute liver failure (ALF) may lead to rapid coma and death. Many patients with ALF die of intracranial hypertension and brain herniation. Ammonia and inflammation are main contributors to these alterations.In rats with ALF, there is an initial disruption of the blood–brain barrier, leading to vasogenic oedema in some brain areas (for example, the cerebellum). Brain ammonia and glutamine levels progressively increase, leading later to cytotoxic oedema in many areas. NMDA receptor activation, increased lactate and altered cerebral blood flow are alterations that occur later and also contribute to the increase in intracranial pressure. Blockade of NMDA receptors delays death in rats with ALF.Chronic liver disease (for example, cirrhosis) leads to progressive alterations in sleep, and cognitive and motor function. HE in cirrhosis may be clinical or minimal (MHE). In clinical HE, the symptoms are evident, and its severity is graded according to the level of impairment of autonomy, changes in consciousness, intellectual function and behaviour.Between 33 and 50% of cirrhotic patients without evident symptoms of HE show MHE, which is characterized by mild cognitive impairment, attention deficits, psychomotor slowing and visuomotor and bimanual coordination impairment, which can be detected by psychometric tests.Early diagnosis and treatment of MHE would improve the quality of life and lifespan of patients and prevent or delay the progression of neurological impairment. Determination of critical flicker frequency or of serum 3-nitrotyrosine levels may hold promise as new tools for the early diagnosis of MHE.Hyperammonaemia and inflammation have synergistic roles in inducing neurological alterations in MHE.The function of neuronal circuits between the basal ganglia, thalamus and cortex that modulate motor activity are altered in MHE owing to altered dopaminergic, glutamatergic and GABAergic neurotransmission. Hypokinesia in rats with MHE is due to increased extracellular glutamate and activation of metabotropic glutamate receptor 1 (mGluR1) in the substantia nigra pars reticulata (SNr). Blockade of mGluR1 in the SNr normalizes neurotransmission and motor activity. Anti-inflammatory drugs or inhibitors of mitogen-activated protein kinase (MAPK) p38 also restore motor activity.A main contributor to cognitive impairment in MHE is the reduced function of the glutamate–nitric oxide–cyclic GMP pathway in the cerebellum, resulting in reduced formation of cGMP in response to activation of NMDA receptors. Learning ability in a Y maze task can be restored in rats with MHE by increasing cGMP in the cerebellum.Learning ability may be restored in rats with MHE by using inhibitors of phosphodiesterase 5, anti-inflammatory drugs (ibuprofen), inhibitors of MAPK p38 or modulators of GABAA receptors, which restore the function of the glutamate–nitric oxide–cGMP pathway and extracellular cGMP. Translation of these results to clinical practice would help to improve cognitive function in patients with MHE.