Neurogenesis is known to take place in the adult brain. This work identifies T lymphocytes and microglia as being important to the maintenance of hippocampal neurogenesis and spatial learning abilities in adulthood. Hippocampal neurogenesis induced by an enriched environment was associated with the recruitment of T cells and the activation of microglia. In immune-deficient mice, hippocampal neurogenesis was markedly impaired and could not be enhanced by environmental enrichment, but was restored and boosted by T cells recognizing a specific CNS antigen. CNS-specific T cells were also found to be required for spatial learning and memory and for the expression of brain-derived neurotrophic factor in the dentate gyrus, implying that a common immune-associated mechanism underlies different aspects of hippocampal plasticity and cell renewal in the adult brain.