Combining high-resolution single cell tracking experiments with numerical simulations, we show that starvation-induced fruiting body (FB) formation in Myxococcus xanthus is a phase separation driven by cells that tune their motility over time. The phase separation can be understood in terms of cell density and a dimensionless Peclet number that captures cell motility through speed and reversal frequency. Our work suggests that M. xanthus take advantage of a self-driven non-equilibrium phase transition that can be controlled at the single cell level.