Thymine DNA glycosylase (TDG) is a member of the uracil DNA glycosylase (UDG) superfamily of DNA repair enzymes. Owing to its ability to excise thymine when mispaired with guanine, it was proposed to act against the mutability of 5-methylcytosine (5-mC) deamination in mammalian DNA(1). However, TDG was also found to interact with transcription factors(2,3), histone acetyltransferases(4) and de novo DNA methyltransferases(5,6), and it has been associated with DNA demethylation in gene promoters following activation of transcription(7-9), altogether implicating an engagement in gene regulation rather than DNA repair. Here we use a mouse genetic approach to determine the biological function of this multifaceted DNA repair enzyme. We find that, unlike other DNA glycosylases, TDG is essential for embryonic development, and that this phenotype is associated with epigenetic aberrations affecting the expression of developmental genes. Fibroblasts derived from Tdg null embryos (mouse embryonic fibroblasts, MEFs) show impaired gene regulation, coincident with imbalanced histone modification and CpG methylation at promoters of affected genes. TDG associates with the promoters of such genes both in fibroblasts and in embryonic stem cells (ESCs), but epigenetic aberrations only appear upon cell lineage commitment. We show that TDG contributes to the maintenance of active and bivalent chromatin throughout cell differentiation, facilitating a proper assembly of chromatin-modifying complexes and initiating base excision repair to counter aberrant de novo methylation. We thus conclude that TDG-dependent DNA repair has evolved to provide epigenetic stability in lineage committed cells.