The contribution of the soil microbes to agroecosystem multifunctionality under global change remains poorly understood. Here, based on data from a field experiment involving elevated carbon dioxide (CO2) and warming in a rice-wheat agroecosystem, we found that soil microbes influence the impact of climate change on agroecosystem functions. The stability of food production during the rice season increased under elevated CO2 but decreased under warming, with no significant changes in the wheat season. The interactive influences of elevated CO2 and warming on agroecosystem multifunctionality were found to be minimal. The abundance of soil fungi and nematode was associated with agroecosystem stability during the rice and wheat seasons, respectively. Soil archaeal diversity and bacterial abundance were linked to agroecosystem multifunctionality in the rice and wheat seasons, respectively. Our work proves the positive effects of soil microbes on agroecosystem functions and highlights the implications of maintaining microbial diversity for agroecosystem health under climate change.