Tumours progress despite being infiltrated by tumour-specific effector T cells1. Tumours contain areas of cellular necrosis, which are associated with poor survival in a variety of cancers2. Here, we show that necrosis releases intracellular potassium ions into the extracellular fluid of mouse and human tumours, causing profound suppression of T cell effector function. Elevation of the extracellular potassium concentration ([K+]e) impairs T cell receptor (TCR)-driven Akt-mTOR phosphorylation and effector programmes. Potassium-mediated suppression of Akt-mTOR signalling and T cell function is dependent upon the activity of the serine/threonine phosphatase PP2A3,4. Although the suppressive effect mediated by elevated [K+]e is independent of changes in plasma membrane potential (Vm), it requires an increase in intracellular potassium ([K+]i). Accordingly, augmenting potassium efflux in tumour-specific T cells by overexpressing the potassium channel Kv1.3 lowers [K+]i and improves effector functions in vitro and in vivo and enhances tumour clearance and survival in melanoma-bearing mice. These results uncover an ionic checkpoint that blocks T cell function in tumours and identify potential new strategies for cancer immunotherapy.