Exhausted CD8 T cells during chronic inflammatory responses against viral infections and cancer are phenotypically and functionally heterogeneous. In particular, CD8 T cells with cytolytic effector function have been recently identified among the exhausted CD8 T cell subsets. However, the regulation of their differentiation and function remains largely unknown. Here, we report that Krüppel-like factor 4 (KLF4) is a critical regulator of the exhaustion process, promoting the cytolytic effector function of exhausted CD8 T cells. KLF4-expressing CD8 T cells in exhaustion contexts showed the features of transitory effector CD8 T cells. Enforced KLF4 expression increased CD8 T cell differentiation into transitory effector subsets and enhanced their antitumor immunity. We further demonstrated that KLF4 also showed a capacity of reinvigorating exhausted CD8 T cells. Last, high KLF4 expression was positively correlated with a favorable prognosis in human patients with cancer. Our study highlights the potential impacts of KLF4 on CD8 T cell exhaustion and antitumor immune therapy.