DNA methylation is extensively reprogrammed during the early phases of mammalian development, yet genomic targets of this process are largely unknown. We optimized methylated DNA immunoprecipitation for low numbers of cells and profiled DNA methylation during early development of the mouse embryonic lineage in vivo. We observed a major epigenetic switch during implantation at the transition from the blastocyst to the postimplantation epiblast. During this period, DNA methylation is primarily targeted to repress the germline expression program. DNA methylation in the epiblast is also targeted to promoters of lineage-specific genes such as hematopoietic genes, which are subsequently demethylated during terminal differentiation. De novo methylation during early embryogenesis is catalyzed by Dnmt3b, and absence of DNA methylation leads to ectopic gene activation in the embryo. Finally, we identify nonimprinted genes that inherit promoter DNA methylation from parental gametes, suggesting that escape of post-fertilization DNA methylation reprogramming is prevalent in the mouse genome.