Cancer-specific TCF1(+) stem-like CD8(+) T cells can drive protective anticancer immunity through expansion and effector cell differentiation(1-4); however, this response is dysfunctional in tumours. Current cancer immunotherapies(2,5-9) can promote anticancer responses through TCF1(+) stem-like CD8(+) T cells in some but not all patients. This variation points towards currently ill-defined mechanisms that limit TCF1(+)CD8(+) T cell-mediated anticancer immunity. Here we demonstrate that tumour-derived prostaglandin E2 (PGE(2)) restricts the proliferative expansion and effector differentiation of TCF1(+)CD8(+) T cells within tumours, which promotes cancer immune escape. PGE(2) does not affect the priming of TCF1(+)CD8(+) T cells in draining lymph nodes. PGE(2) acts through EP(2) and EP(4) (EP(2)/EP(4)) receptor signalling in CD8(+) T cells to limit the intratumoural generation of early and late effector T cell populations that originate from TCF1(+) tumour-infiltrating CD8(+) T lymphocytes (TILs). Ablation of EP(2)/EP(4) signalling in cancer-specific CD8(+) T cells rescues their expansion and effector differentiation within tumours and leads to tumour elimination in multiple mouse cancer models. Mechanistically, suppression of the interleukin-2 (IL-2) signalling pathway underlies the PGE(2)-mediated inhibition of TCF1(+) TIL responses. Altogether, we uncover a key mechanism that restricts the IL-2 responsiveness of TCF1(+) TILs and prevents anticancer T cell responses that originate from these cells. This study identifies the PGE(2)-EP(2)/EP(4) axis as a molecular target to restore IL-2 responsiveness in anticancer TILs to achieve cancer immune control.