Hepatic encephalopathy occurs when the liver fails to detoxify toxic substances, such as ammonia, which are then able to pass into the brain. This causes neurological symptoms ranging from mild confusion to coma. Precipitating factors include gastrointestinal bleeding, infections, and certain drugs. Treatment focuses on reducing ammonia production in the gut through lactulose, antibiotics, and low-protein diets. Correcting electrolyte imbalances and removing precipitating medications or infections are also important for management of hepatic encephalopathy.