The ability of killer T cells carrying the CD8 antigen to detect tumours or intracellular pathogens requires an extensive display of antigenic peptides by major histocompatibility complex (MHC) class I molecules on the surface of potential target cells. These peptides are derived from almost all intracellular proteins and reveal the presence of foreign pathogens and mutations. How cells produce thousands of distinct peptides cleaved to the precise lengths required for binding different MHC class I molecules remains unknown. The peptides are cleaved from endogenously synthesized proteins by the proteasome in the cytoplasm and then trimmed by an unknown aminopeptidase in the endoplasmic reticulum (ER). Here we identify ERAAP, the aminopeptidase associated with antigen processing in the ER. ERAAP has a broad substrate specificity, and its expression is strongly upregulated by interferon-γ. Reducing the expression of ERAAP through RNA interference prevents the trimming of peptides for MHC class I molecules in the ER and greatly reduces the expression of MHC class I molecules on the cell surface. Thus, ERAAP is the missing link between the products of cytosolic processing and the final peptides presented by MHC class I molecules on the cell surface.