Bacterial adaptation to stressful environments often produces evolutionary constraints whereby increases in resistance are associated with reduced fitness in a different environment. The exploitation of this resistance-cost trade-off has been proposed as the basis of rational antimicrobial treatment strategies designed to limit the evolution of drug resistance in bacterial pathogens. Recent theoretical, laboratory, and clinical studies have shown that fluctuating selection can maintain drug efficacy and even restore drug susceptibility, but can also increase the rate of adaptation and promote cross-resistance to other antibiotics. In this paper, we combine mathematical modeling, experimental evolution, and whole-genome sequencing to follow evolutionary trajectories towards β-lactam resistance under fluctuating selective conditions. Our experimental model system consists of eight populations of Escherichia coli K12 evolving in parallel to a serial dilution protocol designed to dynamically control the strength of selection for resistance. We implemented adaptive ramps with mild and strong selection, resulting in evolved populations with similar levels of resistance, but with different evolutionary dynamics and diverging genotypic profiles. We found that mutations that emerged under strong selection are unstable in the absence of selection, in contrast to resistance mutations previously selected in the mild selection regime that were stably maintained in drug-free environments and positively selected for when antibiotics were reintroduced. Altogether, our population dynamics model and the phenotypic and genomic analysis of the evolved populations show that the rate of resistance adaptation is contingent upon the strength of selection, but also on evolutionary constraints imposed by prior drug exposures.