De novo DNA methylation is an essential aspect of the epigenetic reprogramming that takes place during early development, yet factors responsible for its instatement at particular genomic loci are poorly defined. Here, we demonstrate that the KRAB-ZFP-mediated recruitment of KAP1 to DNA in embryonic stem cells (ESCs) induces cytosine methylation. This process is preceded by H3K9 trimethylation, and genome-wide analyses reveal that it spreads over short distances from KAP1-binding sites so as to involve nearby CpG islands. In sharp contrast, in differentiated cells, KRAB/KAP1-induced heterochromatin formation does not lead to DNA methylation. Correspondingly, the methylation status of CpG islands in the adult mouse liver correlates with their proximity to KAP1-binding sites in ESCs, not in hepatocytes. Therefore, KRAB-ZFPs and their cofactor KAP1 are in part responsible for the establishment during early embryogenesis of site-specific DNA methylation patterns that are maintained through development.