Spatiotemporal structures and heterogeneities are common in natural habitats, yet
their role in the evolution of antibiotic resistance is still to be uncovered. We
applied a microfluidic gradient generator device to study the emergence of resistant
bacteria in spatial ciprofloxacin gradients. We observed biofilm formation in regions
with sub-inhibitory concentrations of antibiotics, which quickly expanded into the
high antibiotic regions. In the absence of an explicit structure of the habitat, this
multicellular formation led to a spatial structure of the population with local competition
and limited migration. Therefore, such structures can function as amplifiers of selection
and aid the spread of beneficial mutations. We found that the physical environment
itself induces stress-related mutations that later prove beneficial when cells are
exposed to antibiotics. This shift in function suggests that exaptation occurs in
such experimental scenarios. The above two processes pave the way for the subsequent
emergence of highly resistant specific mutations.