T cells are important in tumour immunity but a better understanding is needed of the differentiation of antigen-specific T cells in human cancer1,2. Here we studied CD8 T cells in patients with human papillomavirus (HPV)-positive head and neck cancer and identified several epitopes derived from HPV E2, E5 and E6 proteins that allowed us to analyse virus-specific CD8 T cells using major histocompatibility complex (MHC) class I tetramers. HPV-specific CD8 T cells expressed PD-1 and were detectable in the tumour at levels that ranged from 0.1% to 10% of tumour-infiltrating CD8 T lymphocytes (TILs) for a given epitope. Single-cell RNA-sequencing analyses of tetramer-sorted HPV-specific PD-1+ CD8 TILs revealed three transcriptionally distinct subsets. One subset expressed TCF7 and other genes associated with PD-1+ stem-like CD8 T cells that are critical for maintaining T cell responses in conditions of antigen persistence. The second subset expressed more effector molecules, representing a transitory cell population, and the third subset was characterized by a terminally differentiated gene signature. T cell receptor clonotypes were shared between the three subsets and pseudotime analysis suggested a hypothetical differentiation trajectory from stem-like to transitory to terminally differentiated cells. More notably, HPV-specific PD-1+TCF-1+ stem-like TILs proliferated and differentiated into more effector-like cells after in vitro stimulation with the cognate HPV peptide, whereas the more terminally differentiated cells did not proliferate. The presence of functional HPV-specific PD-1+TCF-1+CD45RO+ stem-like CD8 T cells with proliferative capacity shows that the cellular machinery to respond to PD-1 blockade exists in HPV-positive head and neck cancer, supporting the further investigation of PD-1 targeted therapies in this malignancy. Furthermore, HPV therapeutic vaccination efforts have focused on E6 and E7 proteins; our results suggest that E2 and E5 should also be considered for inclusion as vaccine antigens to elicit tumour-reactive CD8 T cell responses of maximal breadth.