We find that a small molecule inhibitor of TGFβ receptor I (Alk5) protects cells from the loss of key β cell transcription factors and restores a mature β cell identity even after exposure to prolonged and severe diabetes. Here, TGFBR1 is linked to diabetes mellitus.