Acute hepatopancreatic necrosis disease (AHPND) is an emerging bacterial disease of cultured shrimp caused mainly by Vibrio parahaemolyticus, which harbors the lethal PirAB toxin genes. Although Penaeus vannamei (P. vannamei) postlarvae are susceptible to AHPND, the changes in the bacterial communities through the larval stages affected by the disease are unknown. We characterized, through high-throughput sequencing, the microbiome of P. vannamei larvae infected with AHPND-causing bacteria through the larval stages and compared the microbiome of larvae collected from high- and low-survival tanks. A total of 64 tanks from a commercial hatchery were sampled at mysis 3, postlarvae 4, postlarvae 7, and postlarvae 10 stages. PirAB toxin genes were detected by PCR and confirmed by histopathology analysis in 58 tanks. Seven from the 58 AHPND-positive tanks exhibited a survival rate higher than 60% at harvest, despite the AHPND affectation, being selected for further analysis, whereas 51 tanks exhibited survival rates lower than 60%. A random sample of 7 out of these 51 AHPND-positive tanks was also selected. Samples collected from the selected tanks were processed for the microbiome analysis. The V3–V4 hypervariable regions of the 16S ribosomal RNA (rRNA) gene of the samples collected from both the groups were sequenced. The Shannon diversity index was significantly lower at the low-survival tanks. The microbiomes were significantly different between high- and low-survival tanks at M3, PL4, PL7, but not at PL10. Differential abundance analysis determined that biomarkers associated with high and low survival in shrimp hatchery tanks affected with AHPND. The genera Bacillus, Vibrio, Yangia, Roseobacter, Tenacibaculum, Bdellovibrio, Mameliella, and Cognatishimia, among others, were enriched in the high-survival tanks. On the other hand, Gilvibacter, Marinibacterium, Spongiimonas, Catenococcus, and Sneathiella, among others, were enriched in the low-survival tanks. The results can be used to develop applications to prevent losses in shrimp hatchery tanks affected by AHPND.