Type 1 diabetes (T1D) is caused by a T-cell-mediated destruction of insulin-secreting pancreatic islet β cells. The T1D-predisposing human leukocyte antigen (HLA) class II molecule, DQ8, binds and presents insulin B chain peptides in the thymus producing autoreactive CD4+ T cells1–12. Here, we show that this process is driven by negatively-charged T cell receptor (TCR) complementarity-determining region 3β (CDR3β) sequences interacting with alanine at position 57 of the DQ8 β chain. Since T1D aetiology is linked to gut microbiota dysbiosis13–18, we hypothesized that the commensal proteome contains mimics of the primary insulin B:9-23 epitope that control TCR selection and tolerance. We identified a large set of bacterial proteins with significant similarity to insulin B:9-25, particularly from the transketolase (TKT) superfamily. We isolated a CD4+ TCR with a negatively-charged CDR3β from the pancreas of a DQ8-positive patient that was cross-reactive with one of these TKT peptides and insulin B:9-23. The T1D-protective molecule, DQ6, with the negatively-charged aspartic acid (D) at DQβ57(12,19), showed strong TKT mimotope binding, supporting a role for TKT-specific regulatory T cells in resistance to T1D. We propose that in a DQ8+DQ6− child with a proinflammatory dysbiotic gut microbiota, cross-reactive TKT-insulin B chain peptide T effector cells escape from the thymus and initiate T1D. TKT is a strong candidate because it is highly upregulated during weaning, a key period in T1D aetiology, and hence a prominent target for an autoimmune-prone immune system. Inhibiting gut dysbiosis and improving immune tolerance to TKT and other mimotopes, especially before and during weaning, could be a route to primary prevention of T1D and other common diseases.