Background: The potato tuber moth (PTM), Phthorimaea operculella (Zeller), is a worldwide pest that feeds on both the leaves and tubers of potato plants. PTM larvae can digest leaves, or tubers, resulting in serious damage to potato plants in the field and potato tubers in storage. To understand how midgut bacterial diversity is influenced by the consumption of these two tissue types, the symbiotic bacteria in the potato-feeding PTM midgut and the endophytic bacteria of potato tissues were analyzed. Results: At the genus level, the bacterial community composition in the PTM midgut was influenced by the tissues consumed, owing to their different nutrient contents. Escherichia_Shigella and Enterobacter were the most dominant genera in the midgut of leaf-feeding and tuber-feeding PTMs, respectively. Interestingly, even though only present in low abundance in leaves and tubers, Escherichia_Shigella were dominantly distributed only in the midgut of leaffeeding PTMs, indicating that specific accumulation of these genera have occurred by feeding on leaves. Moreover, Enterobacter, the most dominant genus in the midgut of tuber-feeding PTMs, was undetectable in all potato tissues, indicating it is gut-specific origin and tuber feeding-specific accumulation. Both Escherichia_Shigella and Enterobacter abundances were positively correlated with the dominant contents of potato leaves and tubers, respectively. Conclusions: Enrichment of specific PTM midgut bacterial communities was related to different nutrient levels in different tissues consumed by the insect, which in turn influenced host utilization. We provide evidence that a portion of the intestinal microbes of PTMs may be derived from potato endophytic bacteria and improve the understanding of the relationship between potato endophytic bacteria and the gut microbiota of PTMs, which may offer support for integrated management of this worldwide pest.