The sustainable management of crops is a fundamental challenge as the human population and demand for food increase. Crop rotation, a practice that has been used for centuries, offers a sustainable solution with minimal environmental impact. However, our understanding of how microbial diversity changes during rotation and how microbially mediated functions enhance plant production remains limited. In our study, we combined field surveys of rice–celery rotations with greenhouse experiments. We found that crop rotation increased yield by increasing the presence of plant-beneficial bacteria, including a novel strain named Acinetobacter bohemicus HfQ1. Bacteria that promote plant growth are enriched under crop rotation, leading to increased ammonia oxidation, siderophore production and indole-3-acetic acid synthesis. These beneficial ecological consequences of crop rotation were consistent across various crops during our metadata analysis. Our study provides new insights into the development of innovative crop rotation models and effective strategies to safeguard food production and advance sustainable agriculture. Additionally, the Acinetobacter strain may serve as a potential microbial agent to replace chemical fertilisers, further supporting sustainable agricultural practices.