Despite the efficacy of Hedgehog pathway inhibitors in the treatment of basal cell carcinoma (BCC)1, residual disease persists in some patients and may contribute to relapse when treatment is discontinued2. Here, to study the effect of the Smoothened inhibitor vismodegib on tumour clearance, we have used a Ptch1-Trp53 mouse model of BCC3 and found that mice treated with vismodegib harbour quiescent residual tumours that regrow upon cessation of treatment. Profiling experiments revealed that residual BCCs initiate a transcriptional program that closely resembles that of stem cells of the interfollicular epidermis and isthmus, whereas untreated BCCs are more similar to the hair follicle bulge. This cell identity switch was enabled by a mostly permissive chromatin state accompanied by rapid Wnt pathway activation and reprogramming of super enhancers to drive activation of key transcription factors involved in cellular identity. Accordingly, treatment of BCC with both vismodegib and a Wnt pathway inhibitor reduced the residual tumour burden and enhanced differentiation. Our study identifies a resistance mechanism in which tumour cells evade treatment by adopting an alternative identity that does not rely on the original oncogenic driver for survival.