SummaryIntensive agriculture has major negative impacts on ecosystem diversity and functioning, including that of soils. The associated reduction of soil biodiversity and essential soil functions, such as nutrient cycling, can restrict plant growth and crop yield. By increasing plant diversity in agricultural systems, intercropping could be a promising way to foster soil microbial diversity and functioning. However, plant–microbe interactions and the extent to which they influence crop yield under field conditions are still poorly understood. In this study, we performed an extensive intercropping experiment using eight crop species and 40 different crop mixtures to investigate how crop diversity affects soil microbial diversity and functions, and whether these changes subsequently affect crop yield. Experiments were carried out in mesocosms under natural conditions in Switzerland and in Spain, two countries with drastically different soils and climate, and our crop communities included either one, two or four species. We sampled and sequenced soil microbial DNA to assess soil microbial diversity, and measured soil basal respiration as a proxy for soil activity. Results indicate that in Switzerland, increasing crop diversity led to shifts in soil microbial community composition, and in particular to an increase of several plant-growth promoting microbes, such as members of the bacterial phylum Actinobacteria. These shifts in community composition subsequently led to a 15 and 35% increase in crop yield in 2 and 4-species mixtures, respectively. This suggests that the positive effects of crop diversity on crop productivity can partially be explained by changes in soil microbial composition. However, the effects of crop diversity on soil microbes were relatively small compared to the effects of abiotic factors such as fertilization (3 times larger) or soil moisture (3 times larger). Furthermore, these processes were context-dependent: in Spain, where soil resources were limited, soil microbial communities did not respond to crop diversity, and their effect on crop yield was less strong. This research highlights the potential beneficial role of soil microbial communities in intercropping systems, while also reflecting on the relative importance of crop diversity compared to abiotic drivers of microbiomes, thereby emphasizing the context-dependence of crop–microbe relationships.