Understanding mechanisms governing the resistance and resilience of microbial communities is essential for predicting their ecological responses to environmental disturbances. Although we have a good understanding of such issues for soil and lake ecosystems, how ecological resistance and resilience regulate the microbiota in the fish gut ecosystem remains unclear. Using the zebrafish model, we clarified the potential mechanisms governing the gut microbiota after exposure to silver nanoparticles (AgNPs). Here, we explored the ecological resistance and resilience of gut microbiota in zebrafish exposed to different concentrations of AgNPs (i.e., 10, 33 and 100 μg/liter) for 15, 45, 75 days. The high-throughput sequencing analysis of the 16S rRNA gene showed that AgNP exposure significantly reduced the α-diversity of gut microbiota and resulted in obvious dynamics of community composition and structure. However, the rebound of zebrafish gut microbiota was pushed toward an alternative state after 15 days of AgNP exposure. We found that homogeneous selection was a more prevalent contributor in driving gut community recovery after AgNP exposure. The resilience and resistance of gut microbiota responses to AgNP disturbance might be mainly determined by the predominant keystone taxa such as Acinetobacter and Gemmata. This study not only expanded our understanding of fish gut microbiota's responses to pollutants but also provided new insights into maintaining host-microbiome stability during environmental perturbations. IMPORTANCE Understanding the ecological mechanisms governing the resistance and resilience of microbial communities is a key issue to predict their responses to environmental disturbances. Using the zebrafish model, we wanted to clarify the potential mechanisms governing the resistance and resilience of gut microbiota after exposure to silver nanoparticles (AgNPs). We found that AgNP contamination significantly reduced the α-diversity of gut microbiota and resulted in obvious changes in community composition. The resilience and resistance of gut microbiota to AgNPs might be associated with the predominant keystone taxa (e.g., Acinetobacter and Gemmata). This study greatly expanded our understanding of how fish gut microbiota responds to environmental perturbations and maintains stability.