Dynamic control of cell polarity is of critical importance for many aspects of cellular development and motility. In Myxococcus xanthus, MglA, a G protein, and MglB, its cognate GTPase-activating protein, establish a polarity axis that defines the direction of movement of the cell and that can be rapidly inverted by the Frz chemosensory system. Although vital for collective cell behaviours, how Frz triggers this switch has remained unknown. Here, we use genetics, imaging and mathematical modelling to show that Frz controls polarity reversals via a gated relaxation oscillator. FrzX, which we identify as a target of the Frz kinase, provides the gating and thus acts as the trigger for reversals. Slow relocalization of the polarity protein RomR then creates a refractory period during which another switch cannot be triggered. A secondary Frz output, FrzZ, decreases this delay, allowing rapid reversals when required. Thus, this architecture results in a highly tuneable switch that allows a wide range of reversal frequencies.