METTL3 (methyltransferase-like 3) mediates the N.sup.6-methyladenosine (m.sup.6A) methylation of mRNA, which affects the stability of mRNA and its translation into protein.sup.1. METTL3 also binds chromatin.sup.2-4, but the role of METTL3 and m.sup.6A methylation in chromatin is not fully understood. Here we show that METTL3 regulates mouse embryonic stem-cell heterochromatin, the integrity of which is critical for silencing retroviral elements and for mammalian development.sup.5. METTL3 predominantly localizes to the intracisternal A particle (IAP)-type family of endogenous retroviruses. Knockout of Mettl3 impairs the deposition of multiple heterochromatin marks onto METTL3-targeted IAPs, and upregulates IAP transcription, suggesting that METTL3 is important for the integrity of IAP heterochromatin. We provide further evidence that RNA transcripts derived from METTL3-bound IAPs are associated with chromatin and are m.sup.6A-methylated. These m.sup.6A-marked transcripts are bound by the m.sup.6A reader YTHDC1, which interacts with METTL3 and in turn promotes the association of METTL3 with chromatin. METTL3 also interacts physically with the histone 3 lysine 9 (H3K9) tri-methyltransferase SETDB1 and its cofactor TRIM28, and is important for their localization to IAPs. Our findings demonstrate that METTL3-catalysed m.sup.6A modification of RNA is important for the integrity of IAP heterochromatin in mouse embryonic stem cells, revealing a mechanism of heterochromatin regulation in mammals. Binding of METTL3 to chromatin is enriched over IAP family endogenous retroviral elements in mouse embryonic stem cells, helping to ensure the integrity of heterochromatin at these elements.