Environmental stress caused by anthropogenic impacts is increasing worldwide. Understanding the ecological and evolutionary consequences for biodiversity will be crucial for our ability to respond effectively. Historical exposure to environmental stress is expected to select for resistant species, shifting community composition towards more stress-tolerant taxa. Concurrent with this species sorting process, genotypes within resistant taxa that have the highest relative fitness under severe stress are expected to increase in frequency, leading to evolutionary adaptation. However, empirical demonstrations of these dual ecological and evolutionary processes in natural communities are lacking. Here, we provide the first evidence for simultaneous species sorting and evolutionary adaptation across multiple species within a natural freshwater bacterial community. Using a two-phase stressor experimental design (acidification pre-exposure followed by severe acidification) in aquatic mesocosms, we show that pre-exposed communities were more resistant than naïve communities to taxonomic loss when faced with severe acid stress. However, after sustained severe acidification, taxonomic richness of both pre-exposed and naïve communities eventually converged. All communities experiencing severe acidification became dominated by an acidophilic bacterium,Acidiphilium rubrum, but this species retained greater genetic diversity and followed distinct evolutionary trajectories in pre-exposed relative to naïve communities. These patterns were shared across other acidophilic species, providing repeated evidence for the impact of pre-exposure on evolutionary outcomes despite the convergence of community profiles. Our results underscore the need to consider both ecological and evolutionary processes to accurately predict the responses of natural communities to environmental change.