Background: Intestinal microbiota have been suggested to play an important role in the pathogenesis of obesity and type 2 diabetes. Bariatric surgery improves both conditions and has been associated with changes in intestinal microbiota composition. We investigated the effect of a nonsurgical bariatric technique on intestinal microbiota composition in relation to metabolic improvement. Methods: Seventeen patients with obesity and type 2 diabetes were treated with the nonsurgical duodenal–jejunal bypass liner, which excludes the proximal 60 cm small intestine from food. Fecal samples as well as metabolic parameters reflecting obesity and type 2 diabetes were obtained from the patients at baseline, after 6 months with the device in situ, and 6 months after explantation. Results: After 6 months of treatment, both obesity and type 2 diabetes had improved with a decrease in weight from 106.1 [99.4–123.5] to 97.4 [89.4–114.0] kg and a decrease in HbA 1c from 8.5% [7.6–9.2] to 7.2% [6.3–8.1] (both p < 0.05). This was paralleled by an increased abundance of typical small intestinal bacteria such as Proteobacteria, Veillonella, and Lactobacillus spp. in feces. After removal of the duodenal–jejunal bypass liner, fecal microbiota composition was similar to that observed at baseline, despite persistent weight loss. Conclusion: Improvement of obesity and type 2 diabetes after exclusion of the proximal 60 cm small intestine by treatment with a nonsurgical duodenal–jejunal bypass liner may be promoted by changes in fecal microbiota composition.