Therapies that target the programmed death-1 (PD-1) receptor have shown unprecedented rates of durable clinical responses in patients with various cancer types. One mechanism by which cancer tissues limit the host immune response is via upregulation of PD-1 ligand (PD-L1) and its ligation to PD-1 on antigen-specific CD8(+) T cells (termed adaptive immune resistance). Here we show that pre-existing CD8(+) T cells distinctly located at the invasive tumour margin are associated with expression of the PD-1/PD-L1 immune inhibitory axis and may predict response to therapy. We analysed samples from 46 patients with metastatic melanoma obtained before and during anti-PD-1 therapy (pembrolizumab) using quantitative immunohistochemistry, quantitative multiplex immunofluorescence, and next-generation sequencing for T-cell antigen receptors (TCRs). In serially sampled tumours, patients responding to treatment showed proliferation of intratumoral CD8(+) T cells that directly correlated with radiographic reduction in tumour size. Pre-treatment samples obtained from responding patients showed higher numbers of CD8-, PD-1- and PD-L1-expressing cells at the invasive tumour margin and inside tumours, with close proximity between PD-1 and PD-L1, and a more clonal TCR repertoire. Using multivariate analysis, we established a predictive model based on CD8 expression at the invasive margin and validated the model in an independent cohort of 15 patients. Our findings indicate that tumour regression after therapeutic PD-1 blockade requires pre-existing CD8(+) T cells that are negatively regulated by PD-1/PD-L1-mediated adaptive immune resistance.