Mounting effective immunity against pathogens and tumours relies on the successful metabolic programming of T cells by extracellular fatty acids1-3. Fatty-acid-binding protein 5 (FABP5) has a key role in this process by coordinating the efficient import and trafficking of lipids that fuel mitochondrial respiration to sustain the bioenergetic requirements of protective CD8+ T cells4,5. However, the mechanisms that govern this immunometabolic axis remain unexplored. Here we report that the cytoskeletal organizer transgelin 2 (TAGLN2) is necessary for optimal fatty acid uptake, mitochondrial respiration and anticancer function in CD8+ T cells. TAGLN2 interacts with FABP5 to facilitate its cell surface localization and function in activated CD8+ T cells. Analyses of ovarian cancer specimens revealed that endoplasmic reticulum (ER) stress responses induced by the tumour microenvironment repress TAGLN2 in infiltrating CD8+ T cells, thereby enforcing their dysfunctional state. Restoring TAGLN2 expression in ER-stressed CD8+ T cells increased their lipid uptake, mitochondrial respiration and cytotoxic capacity. Accordingly, chimeric antigen receptor T cells overexpressing TAGLN2 bypassed the detrimental effects of tumour-induced ER stress and demonstrated therapeutic efficacy in mice with metastatic ovarian cancer. Our study establishes the role of cytoskeletal TAGLN2 in T cell lipid metabolism and highlights the potential to enhance cellular immunotherapy in solid malignancies by preserving the TAGLN2-FABP5 axis.