Abstract Bacterial-fungal interactions influence microbial community performance of most ecosystems and elicit specific microbial behaviours, including stimulating specialised metabolite production. Here, we use a co-culture experimental evolution approach to investigate bacterial adaptation to the presence of a fungus, using a simple model of bacterial-fungal interactions encompassing the bacterium Bacillus subtilis and the fungus Aspergillus niger . We find in one evolving population that B. subtilis was selected for enhanced production of the lipopeptide surfactin and accelerated surface spreading ability, leading to inhibition of fungal expansion and acidification of the environment. These phenotypes were explained by specific mutations in the DegS-DegU two-component system. In the presence of surfactin, fungal hyphae exhibited bulging cells with delocalised secretory vesicles possibly provoking an RlmA-dependent cell wall stress. Thus, our results indicate that the presence of the fungus selects for increased surfactin production, which inhibits fungal growth and facilitates the competitive success of the bacterium.