E. coli DNA gyrase uses the energy of ATP hydrolysis to introduce essential negative supercoils into the genome, thereby working against the mechanical stresses that accumulate in supercoiled DNA. Using a magnetic-tweezers assay, we demonstrate that small changes in force and torque can switch gyrase among three distinct modes of activity. Under low mechanical stress, gyrase introduces negative supercoils by a mechanism that depends on DNA wrapping. Elevated tension or positive torque suppresses DNA wrapping, revealing a second mode of activity that resembles the activity of topoisomerase IV. This distal T-segment capture mode results in active relaxation of left-handed braids and positive supercoils. A third mode is responsible for the ATP-independent relaxation of negative supercoils. We present a branched kinetic model that quantitatively accounts for all of our single-molecule results and agrees with existing biochemical data.