Nucleotide metabolism is the ultimate and most critical link in the self-replication process of tumors, including gastric cancer (GC). However, in clinical treatment, classic antitumor drugs such as 5-fluorouracil (5-FU) are mostly metabolic analogs of purines or pyrimidines, which lack specificity for tumor cells and therefore have significant side effects. It is unclear whether there are other drugs that can target nucleotide metabolism, except for nucleic acid analogs. Here, we found that a natural compound, dehydroabietylamine (DHAA), significantly reduced the viability and proliferation of GC cells and organoids. DHAA disrupts the purine and pyrimidine metabolism of GC cells, causing DNA damage and further inducing apoptosis. DHAA treatment decreased transcription and protein levels of key enzymes involved in the nucleotide metabolism pathway, with significant reductions in the expression of pyrimidine metabolism key enzymes CAD, DHODH, and purine metabolism key enzymes PAICS. We also found that DHAA directly binds to and reduces the expression of Forkhead box K2 (FOXK2), a common transcription factor for these metabolic enzymes. Ultimately, DHAA was shown to delay tumorigenesis in K19-Wnt1/C2mE transgenic mice model and reduce levels of CAD, DHODH, and PAICS in vivo. We demonstrate that DHAA exerts an anticancer effect on GC by targeting transcription factor FOXK2, reducing transcription of key genes for nucleotide metabolism and impairing nucleotide biosynthesis, thus DHAA is a promising candidate for GC therapy.