Swarming bacteria are challenged by the need to invade hostile environments. Swarms of the flagellate bacterium Paenibacillus vortex can collectively transport non-motile microorganisms. Here we show that P. vortex can invade toxic environments by carrying antibiotic-degrading bacteria, transport being mediated by a specialized, phenotypic subpopulation. Swarms of beta-lactam antibiotic (BLA)-sensitive P. vortex can carry beta-lactamase-producing, resistant, cargo bacteria to detoxify BLAs in their path. In the presence of BLAs, both transporter and cargo bacteria gained from this temporary cooperation, cargo bacteria with higher MICs promoted faster spread. P. vortex only transported the most beneficial antibiotic-resistant cargo (including clinical isolates) in a sustained way. P. vortex displayed a bet-hedging strategy that promoted the colonization of non-toxic niches by P. vortex alone; when detoxifying cargo bacteria were not needed they were lost. This work has implications for the dispersal of antibiotic-resistant microorganisms and strategies for asymmetric cooperation.