DNA methylation profiling of virus-specific T cells during acute viral infection in mice provides evidence that a fate-permissive subset of effector CD8 T cells dedifferentiates into long-lived memory T cells. Memory cells protect against reinfection, or protect against infection after vaccination, but whether they are derived from naive or effector T cells is unknown. Rafi Ahmed and colleagues study the generation, maintenance and characteristics of long-lived memory CD8 T cells in humans after yellow fever vaccination and deuterium labelling. The study demonstrates that long-lived memory CD8 T cells are derived from cells that have divided extensively during the effector phase of the infection. Quiescent memory cells appear to revert to a naive phenotype but maintain an upregulated pattern of gene regulation that resembles effector T cells. In a second paper in this issue, Rafi Ahmed and colleagues examine changes in DNA methylation during effector and memory CD8 T cell differentiation, providing support for a model in which long-lived memory cells arise from a precursor of effector cells. Memory CD8 T cells that circulate in the blood and are present in lymphoid organs are an essential component of long-lived T cell immunity. These memory CD8 T cells remain poised to rapidly elaborate effector functions upon re-exposure to pathogens, but also have many properties in common with naive cells, including pluripotency and the ability to migrate to the lymph nodes and spleen. Thus, memory cells embody features of both naive and effector cells, fuelling a long-standing debate centred on whether memory T cells develop from effector cells or directly from naive cells1,2,3,4. Here we show that long-lived memory CD8 T cells are derived from a subset of effector T cells through a process of dedifferentiation. To assess the developmental origin of memory CD8 T cells, we investigated changes in DNA methylation programming at naive and effector cell-associated genes in virus-specific CD8 T cells during acute lymphocytic choriomeningitis virus infection in mice. Methylation profiling of terminal effector versus memory-precursor CD8 T cell subsets showed that, rather than retaining a naive epigenetic state, the subset of cells that gives rise to memory cells acquired de novo DNA methylation programs at naive-associated genes and became demethylated at the loci of classically defined effector molecules. Conditional deletion of the de novo methyltransferase Dnmt3a at an early stage of effector differentiation resulted in reduced methylation and faster re-expression of naive-associated genes, thereby accelerating the development of memory cells. Longitudinal phenotypic and epigenetic characterization of the memory-precursor effector subset of virus-specific CD8 T cells transferred into antigen-free mice revealed that differentiation to memory cells was coupled to erasure of de novo methylation programs and re-expression of naive-associated genes. Thus, epigenetic repression of naive-associated genes in effector CD8 T cells can be reversed in cells that develop into long-lived memory CD8 T cells while key effector genes remain demethylated, demonstrating that memory T cells arise from a subset of fate-permissive effector T cells.