Abstract During chronic viral infection and cancer, a CD8 T cell subset with stem-like characteristics maintains long-term T cell immunity and mediates the response induced by immune checkpoint blockade. The transcriptional and epigenetic programs of stem-like CD8 T cells diverged from those of other CD8 subsets early in the immune response. Using mice with chronic lymphocytic choriomeningitis virus (LCMV) infection, we found that the gene encoding transcriptional repressor BACH2 was highly expressed in stem-like CD8 T cells but was epigenetically silenced in terminally exhausted CD8 T cells early after infection. Ectopic expression of BACH2 enforced the transcriptional and epigenetic programs of stem-like CD8 T cells and restrained antiviral CD8 T cells in the lymphoid tissues. BACH2 deficiency impaired the differentiation of stem-like CD8 T cells and dysregulated their molecular program. We further demonstrated that BACH2 promoted stem-like CD8 T cell differentiation by suppressing BLIMP1 and RUNX3 pathways. In summary, our results showed that transcriptional repressor BACH2 drove stem-like CD8 T cell differentiation by guarding them against alternative cell fate.