The molecular mechanisms underlying the antineoplastic properties of metformin, a first-line drug for type 2 diabetes, remain elusive. Here we report that metformin induces genome-wide alterations in DNA methylation by modulating the activity of S-adenosylhomocysteine hydrolase (SAHH). Exposing cancer cells to metformin leads to hypermethylation of tumor-promoting pathway genes and concomitant inhibition of cell proliferation. Metformin acts by upregulating microRNA let-7 through AMPK activation, leading to degradation of H19 long noncoding RNA, which normally binds to and inactivates SAHH. H19 knockdown activates SAHH, enabling DNA methyltransferase 3B to methylate a subset of genes. This metformin-induced H19 repression and alteration of gene methylation are recapitulated in endometrial cancer tissue samples obtained from patients treated with antidiabetic doses of metformin. Our findings unveil a novel mechanism of action for the drug metformin with implications for the molecular basis of epigenetic dysregulation in cancer. This novel mechanism of action also may be occurring in normal cells.