Glutamine synthetase (GS) is the only known enzyme that synthesizes glutamine in mammals. Here we show that mammalian GS utilizes glutamate and methylamine to produce a methylated glutamine analogue, N5-methylglutamine. Untargeted metabolomics revealed that liver-specific deletion of Glul and pharmacologic inhibition of GS, suppress the hepatic and circulating levels of N5-methylglutamine in mice. Conversely, N5-methylglutamine levels are sustained by the metabolism of gut microbiome. This alternative activity of GS was confirmed using human recombinant enzyme and cells where a pathogenic mutation promotes the synthesis of N5-methylglutamine over glutamine. Finally, we show that the urine level of N5-methylglutamine correlates with tumour burden in a novel -catenin-driven model of liver cancer with high GS expression, disclosing the potential of N5-methylglutamine as a biomarker for GS-positive hepatocellular carcinoma.