Hydropower dams are an important green renewable energy technology, but their effect on the gut microbes of fish in different habitats surrounding the dams is unclear. We collected the gut of seven fish species (n = 109 fish) both upstream and downstream of a dam in Xijiang River basin, China, and identified the microbes present by 16s rRNA pyrosequencing. A total of 9,071 OTUs were identified from 1,576,253 high-quality tags with 97% sequence similarity. Our results indicated that the gut microbial diversity of upstream fish was significantly higher than that of downstream fish, though the dominant microbial species were similar and mainly comprised Proteobacteria (mean 35.0%), Firmicutes (20.4%) and Actinobacteria (15.6%). The presence of the dam markedly altered the gut microbial composition in Squaliobarbus curriculusand Hypostomus plecostomus. Moreover, we found specificity in the composition of gut microorganisms in fishes of different diets and pelagic levels, whereas the omnivorous Pseudohemiculter dispar had a higher level of species richness and diversity of gut bacteria compared with the other species. The results of the functional analysis showed that the abundance of microorganisms related to energy metabolism (e.g., amino acid metabolism, carbohydrate metabolism, biosynthesis metabolism) was significantly higher in the gut of upstream fish than in downstream fish. Our results showed that the hydropower station affected downstream levels of chlorophyll-a, total nitrogen and total organic carbon. Canonical correspondence analysis showed that water temperature, Hg and chlorophyll-a significantly affected gut microbial composition. These results are important for assessing the impact of hydropower plant on fish gut microbes and their potential environmental risks.