Differential DNA methylation of the paternal and maternal alleles regulates the parental origin-specific expression of imprinted genes in mammals. The methylation imprints are established in male and female germ cells during gametogenesis, and the de novo DNA methyltransferase DNMT3A and its cofactor DNMT3L are required in this process. However, the mechanisms underlying locus- and parental-specific targeting of the de novo DNA methylation machinery in germline imprinting are poorly understood. Here we show that amine oxidase (flavin-containing) domain 1 (AOF1), a protein related to the lysine demethylase KDM1 (also known as LSD1), functions as a histone H3 lysine 4 (H3K4) demethylase and is required for de novo DNA methylation of some imprinted genes in oocytes. AOF1, now renamed lysine demethylase 1B (KDM1B) following a new nomenclature, is highly expressed in growing oocytes where genomic imprints are established. Targeted disruption of the gene encoding KDM1B had no effect on mouse development and oogenesis. However, oocytes from KDM1B-deficient females showed a substantial increase in H3K4 methylation and failed to set up the DNA methylation marks at four out of seven imprinted genes examined. Embryos derived from these oocytes showed biallelic expression or biallelic suppression of the affected genes and died before mid-gestation. Our results suggest that demethylation of H3K4 is critical for establishing the DNA methylation imprints during oogenesis.