B cells diversify and affinity mature their antigen receptor repertoire in germinal centers (GCs). GC B cells receive help signals during transient interaction with T cells, yet it remains unknown how these transient T-B interactions in the light zone sustain the subsequent proliferative program of selected B cells that occurs in the anatomically distant dark zone. Here, we show that the transcription factor AP4 was required for sustained GC B cell proliferation and subsequent establishment of a diverse and protective antibody repertoire. AP4 was induced by c-MYC during the T-B interactions, was maintained by T-cell-derived interleukin-21 (IL-21), and promoted repeated rounds of divisions of selected GC B cells. B-cell-specific deletion of AP4 resulted in reduced GC sizes and reduced somatic hypermutation coupled with a failure to control chronic viral infection. These results indicate that AP4 integrates T-cell-mediated selection and sustained expansion of GC B cells for humoral immunity.