A major challenge in theoretical ecology is understanding how natural microbial communities support species diversity, and in particular how antibiotic-producing, -sensitive and -resistant species coexist. While cyclic ‘rock–paper–scissors’ interactions can stabilize communities in spatial environments, coexistence in unstructured environments remains unexplained. Here, using simulations and analytical models, we show that the opposing actions of antibiotic production and degradation enable coexistence even in well-mixed environments. Coexistence depends on three-way interactions in which an antibiotic-degrading species attenuates the inhibitory interactions between two other species. These interactions enable coexistence that is robust to substantial differences in inherent species growth rates and to invasion by ‘cheating’ species that cease to produce or degrade antibiotics. At least two antibiotics are required for stability, with greater numbers of antibiotics enabling more complex communities and diverse dynamic behaviours ranging from stable fixed points to limit cycles and chaos. Together, these results show how multi-species antibiotic interactions can generate ecological stability in both spatially structured and mixed microbial communities, suggesting strategies for engineering synthetic ecosystems and highlighting the importance of toxin production and degradation for microbial biodiversity.