The glutamine synthetase (GS) facilitates cancer cell growth by catalyzing de novo glutamine synthesis. This enzyme removes ammonia waste from the liver following the urea cycle. Since cancer development is associated with dysregulated urea cycles, there has been no investigation of GS's role in ammonia clearance. Here, we demonstrate that, although GS expression is increased in the setting of β-catenin oncogenic activation, it is insufficient to clear the ammonia waste burden due to the dysregulated urea cycle and may thus be unable to prevent cancer formation. In vivo study, a total of 165 male Swiss albino mice allocated in 11 groups were used, and liver cancer was induced by p-DAB. The activity of GS was evaluated along with the relative expression of mTOR, β-catenin, MMP-14, and GS genes in liver samples and HepG2 cells using qRT-PCR. Moreover, the cytotoxicity of the NH3 scavenger phenyl acetate (PA) and/or GS-inhibitor L-methionine sulfoximine (MSO) and the migratory potential of cells was assessed by MTT and wound healing assays, respectively. The Swiss target prediction algorithm was used to screen the mentioned compounds for probable targets. The treatment of the HepG2 cell line with PA plus MSO demonstrated strong cytotoxicity. The post-scratch remaining wound area (%) in the untreated HepG2 cells was 2.0%. In contrast, the remaining wound area (%) in the cells treated with PA, MSO, and PA + MSO for 48 h was 61.1, 55.8, and 78.5%, respectively. The combination of the two drugs had the greatest effect, resulting in the greatest decrease in the GS activity, β-catenin, and mTOR expression. MSO and PA are both capable of suppressing mTOR, a key player in the development of HCC, and MMP-14, a key player in the development of HCC. PA inhibited the MMP-14 enzyme more effectively than MSO, implying that PA might be a better way to target HCC as it inhibited MMP-14 more effectively than MSO. A large number of abnormal hepatocytes (5%) were found to be present in the HCC mice compared to mice in the control group as determined by the histopathological lesions scores. In contrast, PA, MSO, and PA + MSO showed a significant reduction in the hepatic lesions score either when protecting the liver or when treating the liver. The molecular docking study indicated that PA and MSO form a three-dimensional structure with NF-κB and COX-II, blocking their ability to promote cancer and cause gene mutations. PA and MSO could be used to manipulate GS activities to modulate ammonia levels, thus providing a potential treatment for ammonia homeostasis.