A successful T cell immune response has two major products: effector T cells which directly or indirectly remove the antigens, and memory T cells, which allow a faster and more efficient recall response when challenged by related antigens. An important issue is whether costimulatory molecules on the antigen-presenting cells are involved in determining whether T cells will differentiate into effector or memory cells after antigenic stimulation. To address this issue, we have produced mice with targeted mutations of either the heat-stable antigen (HSA), or both HSA and CD28. We show that CD28/B7 and HSA provide two alternative costimulatory pathways for induction of immunological memory to influenza virus. Furthermore, our results revealed that B7 is essential for the generation of effector T cells from either naive or memory T cells, while HSA is not necessary for the generation of effector T cells. Our results demonstrate that the induction of memory T cells and effector T cells can utilize distinct costimulatory molecules. These results have important implications on lineage relationship between effector and memory T cells.