KLF4 (GKLF/EZF) encodes a transcription factor that is associated with both tumour suppression and oncogenesis. We describe the identification of KLF4 in a functional genomic screen for genes that bypass RAS(V12)-induced senescence. However, in untransformed cells, KLF4 acts as a potent inhibitor of proliferation. KLF4-induced arrest is bypassed by oncogenic RAS(V12) or by the RAS target cyclin-D1. Remarkably, inactivation of the cyclin-D1 target and the cell-cycle inhibitor p21CIP1 not only neutralizes the cytostatic action of KLF4, but also collaborates with KLF4 in oncogenic transformation. Conversely, KLF4 suppresses the expression of p53 by directly acting on its promoter, thereby allowing for RAS(V12)-mediated transformation and causing resistance to DNA-damage-induced apoptosis. Consistently, KLF4 depletion from breast cancer cells restores p53 levels and causes p53-dependent apoptosis. These results unmask KLF4 as a regulator of p53 that oncogenically transforms cells as a function of p21CIP1 status. Furthermore, they provide a mechanistic explanation for the context-dependent oncogenic or tumour-suppressor functions of KLF4.