The traditional anti-diabetic drug, metformin, has been found to have anticancer effects. The Sonic hedgehog (Shh) signaling pathway is involved in the on cogenesis of gastric cancer. The aim of the present study was to investigate whether metformin has an effect on the Shh signaling pathway in gastric cancer cells. HGC-27 and MKN-45 human gastric cancer cells were treated with metformin at different concentrations and for different durations. Subsequently the mRNA and protein levels of Shh, Smoothened (SMO), and Glioma-associated oncogene (Gli)-1, Gli-2 and Gli-3 were examined using western blot and reverse transcriptionquan-titative polymerase chain reaction analyses. RNA interference was used to detect whether the effects of metformin treatment on the Shh signaling pathway were dependent on AMP-activated protein kinase (AMPK). The results revealed that the protein and mRNA levels of Shh and Gli-1 were decreased by metformin treatment in the two cell lines in a dose-and time-dependent manner. Metformin also significantly inhibited the gene and protein expression levels of SMO, Gli-2 and Gli-3. The small interfering RNA-induced depletion of AMPK reversed the suppressive effect of metformin on recombinant human Shh-induced expression of Gli-1 in HGC-27 gastric cancer cells. Therefore, metformin inhibited the Shh signaling pathway in the gastric cancer cell lines and the inhibitory effect of metformin on the Shh pathway was AMPK-dependent.