ObjectiveXiaotan Sanjie recipe (XTSJ), a Chinese herbal compound medicine, exerts a significant inhibitory effect on gastric cancer (GC) metastasis. This work investigated the mechanism underlying the XTSJ-mediated inhibition of GC metastasis. MethodsThe effect of XTSJ on GC metastasis and the associated mechanism were investigated in vitro, using GC cell lines, and in vivo, using a GC mouse model, by focusing on the expression of Glc-N-Ac-transferase V (GnT-V; encoded by MGAT5). ResultsThe migration and invasion ability of GC cells decreased significantly after XTSJ administration, which confirmed the efficacy of XTSJ in treating GC in vitro. XTSJ increased the accumulation of E-cadherin at junctions between GC cells, which was reversed by MGAT5 overexpression. XTSJ administration and MGAT5 knockdown alleviated the structural abnormality of the cell–cell junctions, while MGAT5 overexpression had the opposite effect. MGAT5 knockdown and XTSJ treatment also significantly increased the accumulation of proteins associated with the E-cadherin-mediated adherens junction complex. Furthermore, the expression of MGAT5 was significantly lower in the lungs of BGC-823-MGAT5 + XTSJ mice than in those of BGC-823-MGAT5 + solvent mice, indicating that the ability of gastric tumors to metastasize to the lung was decreased in vivo following XTSJ treatment. ConclusionXTSJ prevented GC metastasis by inhibiting the GnT-V-mediated E-cadherin glycosylation and promoting the E-cadherin accumulation at cell–cell junctions.