The release of Escherichia coli (E. coli) O157:H7 has been widely found in various environments, but little is known about the probable influence of the transient E. coli O157:H7 invasion on the native microbial community. Here, we investigated the temporal response of two bacterial biospheres (abundant and rare) of two marsh sediments against E. coli O157:H7 during a 60-day incubation. The diversity of both biospheres showed no evident response to O157:H7 invasion. Temporal factor exhibited greater effects on bacterial variation than O157:H7 invasion. We found that O157:H7 invasion led to an increase in the niche breadth of the bacterial community while decreasing the efficiency of bacterial interaction of the abundant taxa. Moreover, the rare biosphere exhibited enhanced stability against O157:H7 invasion compared with the abundant biosphere, acting as the backbone in resisting external disturbance. Furthermore, each subcommunity assembly showed different randomness levels. The stochastic events were relatively more important in constraining the abundant taxa assembly after invasion. Collectively, E. coli O157:H7 exhibited diverse tangible impact on both biospheres, which unearthed differential responses of abundant and rare biosphere against transient microbial invasion.