T cells recognize antigens presented by MHC molecules on other cells. Antigens from intracellular sources such as viruses are processed and presented by MHC class I to CD8+ T cells. Antigens from extracellular sources such as bacteria that are endocytosed are processed and presented by MHC class II to CD4+ T cells. The antigen processing pathways and the classes of MHC molecules that present the peptides allow the immune system to mount appropriate responses targeting different types of pathogens.