It has been proposed that impairment of the glutamate-nitric oxide-cyclic guanosine monophosphate (cGMP) pathway in brain contributes to cognitive impairment in hepatic encephalopathy. The aims of this work were to assess whether the function of this pathway and of nitric oxide synthase (NOS) are altered in cerebral cortex in vivo in rats with chronic liver failure due to portacaval shunt (PCS) and whether these alterations are due to hyperammonemia. The glutamate-nitric oxide-cGMP pathway function and NOS activation by NMDA was analysed by in vivo microdialysis in cerebral cortex of PCS and control rats and in rats with hyperammonemia without liver failure. Similar studies were done in cortical slices from these rats and in cultured cortical neurons exposed to ammonia. Basal NOS activity, nitrites and cGMP are increased in cortex of rats with hyperammonemia or liver failure. These increases seem due to increased inducible nitric oxide synthase expression. NOS activation by NMDA is impaired in cerebral cortex in both animal models and in neurons exposed to ammonia. Chronic liver failure increases basal NOS activity, nitric oxide and cGMP but reduces activation of NOS induced by NMDA receptors activation. Hyperammonemia is responsible for both effects which will lead, independently, to alterations contributing to neurological alterations in hepatic encephalopathy.