Aims/hypothesis Drug and surgical-based therapies in type 2 diabetes are associated with altered gut microbiota architecture. Here we investigated the role of the gut microbiome in improved glucose homeostasis following bariatric surgery. Methods We carried out gut microbiome analyses in gastrectomised (by vertical sleeve gastrectomy [VSG]) rats of the Goto–Kakizaki (GK) non-obese model of spontaneously occurring type 2 diabetes, followed by physiological studies in the GK rat. Results VSG in the GK rat led to permanent improvement of glucose tolerance associated with minor changes in the gut microbiome, mostly characterised by significant enrichment of caecal Prevotella copri. Gut microbiota enrichment with P. copri in GK rats through permissive antibiotic treatment, inoculation of gut microbiota isolated from gastrectomised GK rats, and direct inoculation of P. copri, resulted in significant improvement of glucose tolerance, independent of changes in body weight. Plasma bile acids were increased in GK rats following inoculation with P. copri and P. copri-enriched microbiota from VSG-treated rats; the inoculated GK rats then showed increased liver glycogen and upregulated expression of Fxr (also known as Nr1h4), Srebf1c, Chrebp (also known as Mlxipl) and Il10 and downregulated expression of Cyp7a1. Conclusions Our data underline the impact of intestinal P. copri on improved glucose homeostasis through enhanced bile acid metabolism and farnesoid X receptor (FXR) signalling, which may represent a promising opportunity for novel type 2 diabetes therapeutics.