In this study, we use the bacterium Escherichia coli to examine evolutionary responses to environmental acidity fluctuating temporally among pH 5.3, 6.3, 7.0, and 7.8 (5,000-15 nM [H(+)]). Two experimental protocols of temporal variation were used. One group (six replicate lines) of populations evolved for 2,000 generations during exposure to a cycled regime fluctuating daily between pH 5.3 and 7.8. The other group (also in six replicate lines) evolved during exposure for 2,000 generations to a randomly shifting regime fluctuating stochastically each day among pH 5.3, 6.3, 7.0, and 7.8. Adaptation to these fluctuating acidity regimes was measured as a change in fitness relative to the common ancestor by direct competition experiments in both constant and fluctuating pH regimes. For comparisons with constant pH evolution, a group evolved at a constant pH of 5.3 and another group evolved at pH 7.8 were also tested. This study initiated the first long-term laboratory natural selection experiment on adaptation to variable acidity and addressed key questions concerning patterns of adaptation (trade-offs, specialists, generalists, plasticity, transitions, and acclimation) in temporally fluctuating environments.