Hyperammonemia, a condition present in patients with urea cycle disorders (UCDs) or liver diseases, can cause neuropsychiatric complications, which in the worst cases result in brain damage, coma or death. Diverse treatments exist for the treatment of hyperammonemia, but they have limited efficacy, adverse effects and elevated cost. Gene therapy is a promising alternative that is explored here. A baculovirus, termed Bac-GS, containing the glutamine synthetase (GS) gene was constructed for the in vitro and in vivo treatment of hyperammonemia. Transduction of MA104 epithelial or L6 myoblast/myotubes cells with Bac-GS resulted in a high expression of the GS gene, an increase in GS concentration, and a reduction of almost half of exogenously added ammonia. When Bac-GS was tested in an acute hyperammonemia rat model by intramuscularly injecting the rear legs, the concentration of ammonia in blood decreased 351 μm, in comparison with controls. A high GS concentration was detected in gastrocnemius muscles from the rats transduced with Bac-GS. These results show that gene delivery for overexpressing GS in muscle tissue is a promising alternative for the treatment of hyperammonemia in patients with acute or chronic liver diseases and hepatic encephalopathy or UCD.