Ammonia is a ubiquitous waste product of protein metabolism that can accumulate in numerous metabolic disorders, causing neurological dysfunction ranging from cognitive impairment to tremor, ataxia, seizures, coma and death. The brain is especially vulnerable to ammonia as it readily crosses the blood-brain barrier in its gaseous form, NH3, and rapidly saturates its principal removal pathway located in astrocytes. Thus, we wanted to determine how astrocytes contribute to the initial deterioration of neurological functions characteristic of hyperammonemia in vivo. Using a combination of two-photon imaging and electrophysiology in awake head-restrained mice, we show that ammonia rapidly compromises astrocyte potassium buffering, increasing extracellular potassium concentration and overactivating the Na(+)-K(+)-2Cl(-) cotransporter isoform 1 (NKCC1) in neurons. The consequent depolarization of the neuronal GABA reversal potential (EGABA) selectively impairs cortical inhibitory networks. Genetic deletion of NKCC1 or inhibition of it with the clinically used diuretic bumetanide potently suppresses ammonia-induced neurological dysfunction. We did not observe astrocyte swelling or brain edema in the acute phase, calling into question current concepts regarding the neurotoxic effects of ammonia. Instead, our findings identify failure of potassium buffering in astrocytes as a crucial mechanism in ammonia neurotoxicity and demonstrate the therapeutic potential of blocking this pathway by inhibiting NKCC1.