How ecosystem functioning changes with microbial communities remains an open question in natural ecosystems. Both present-day environmental conditions and historical events, such as past differences in dispersal, can have a greater influence over ecosystem function than the diversity or abundance of both taxa and genes. Here, we estimated how individual and interactive effects of microbial community structure defined by diversity and abundance, present-day environmental conditions, and an indicator of historical legacies influenced ecosystem functioning in lake sediments. We studied sediments because they have strong gradients in all three of these ecosystem properties and deliver important functions worldwide. By characterizing bacterial community composition and functional traits at eight sites fed by discrete and contrasting catchments, we found that taxonomic diversity and the normalized …