Recent research suggests that the first-line oral antidiabetes drug metformin may prevent gastric cancer progression and improve prognosis. Many studies have also shown that long noncoding RNAs (lncRNAs) play important roles in many biological processes. Therefore, we aimed to explore whether lncRNAs participate in the mechanisms by which metformin affects gastric cancer cells. In the current study, we found that metformin significantly inhibited the cellular functions of gastric cancer cells through Cell Counting Kit-8 and invasion assays. We found that lncRNA H19 was greatly downregulated in gastric cancer cells treated with metformin using lncRNA microassays. Based on bioinformatics analyses of the Oncomine and The Cancer Genome Atlas databases, H19 is shown to be overexpressed in gastric cancer tissues, with increased expression of H19 relating to advanced pathological tumor stage and pathological tumor node metastasis stage, indicating that H19 may be associated with the invasive ability of gastric cancer. We knocked down H19 in AGS and SGC7901 cell lines and found that knocked-down H19 could decrease gastric cancer cell invasion and that metformin could not further decrease invasion after the knock down. Moreover, H19 depletion increased AMPK activation and decreased MMP9 expression, and metformin could not further activate AMPK or decrease MMP9 in H19 knocked-down gastric cancer cells. In summary, metformin has a profound antitumor effect on gastric cancer cells, and H19 is a key component in the process of metformin suppressing gastric cancer cell invasion.