Acute hepatopancreatic necrosis disease (AHPND), a high-mortality-rate shrimp disease, is caused by specific Vibrio parahaemolyticus (Vp) strains with a plasmid encoding the PirABVp toxins. As a bacterial pathogen, the invasion of AHPND-causing Vp might impose pressure on commensal microbiota in the shrimp gut, while the relationship between the pathogenesis of AHPND and the dysbiosis of gut bacterial communities remains unclear. Here we explored the temporal changes of shrimp gut microbiota in response to AHPND-causing and non-AHPND-causing Vp strains, with the non-infected controls as a baseline of the shrimp gut microbiota. The diversity and composition of bacterial communities from 168 gut samples (covering three treatments at seven time points with eight individuals per set) were investigated using 16S rRNA gene metabarcoding with high-throughput sequencing. The results showed that (i) species diversity of gut bacterial communities declined in Vp-infected shrimp, independent of the strain pathogenicity; (ii) taxonomic compositions of gut bacterial communities were significantly different between shrimp infected by AHPND-causing and non-AHPND-causing Vp strains; (iii) short-term (within 6 hours) compositional shifts in the gut microbiota were found only in AHPND-causing Vp-infected shrimp; (iv) the gut microbiota of AHPND-causing Vp-infected shrimp was enriched with genera Photobacterium and Vibrio, with a decline in Candidatus Bacilliplasma; and (v) functional predictions suggested the loss of normal metabolism due to compositional shifts in the gut microbiota. Our work reveals distinct features of community dynamics in shrimp gut microbiota, associated with pathogenic versus non-pathogenic Vibrio infections, providing a new perspective of the pathogenesis of AHPND. IMPORTANCE Shrimp production is continually threatened by newly emerging diseases, such as AHPND, which is caused by specific Vp strains. Previous studies on the pathogenesis of AHPND have mainly focused on the histopathology and immune responses of the host. However, more attention needs to be paid to the gut microbiota, which acts as the first barrier to pathogen colonization. In this study, we revealed that shrimp gut microbiota responded differently to pathogenic and non-pathogenic Vp strains, with bacterial genera Photobacterium and Vibrio enriched in pathogenic Vp-infected shrimp, and Candidatus Bacilliplasma enriched in non-pathogenic Vp-infected shrimp. Moreover, functional predictions suggested that changes in taxonomic compositions would further affect normal metabolic functions, emphasizing the importance of sustaining an equilibrium in the gut microbiota. Several biomarkers associated with specific microbial taxa and functional pathways were identified in our data sets, which help predict the incidence of disease outcomes.