The Holliday junction (HJ) is a key intermediate structure formed during DNA recombination across all kingdoms of life. In bacteria, the HJ is processed by two homo-hexameric RuvB motors, which belong to the AAA+-ATPase family and assemble together with the RuvA-HJ complex to energize the strand exchange reaction. Despite its importance for chromosome maintenance, the structure and the mechanism by which this complex facilitates branch migration are unknown. Here, using time-resolved cryogenic electron microscopy (cryoEM), we obtained structures of the ATP-hydrolysing RuvAB complex in seven distinct conformational states at 2.9-3.4 Å resolution, captured during assembly and processing of a HJ. Five structures together resolve the complete nucleotide cycle of the RuvB motor and reveal the spatiotemporal relationship between ATP hydrolysis, nucleotide exchange and conformational changes in RuvB. We show how coordinated motions in a converter module, formed by DNA-disengaged RuvB subunits, stimulate ATP hydrolysis and nucleotide exchange. Immobilization of this module enables RuvB hexamers to convert the ATP-contained energy into a lever motion, which generates the pulling force driving the strand exchange reaction. We show structurally that the nucleotide cycle progresses around the ring, that RuvB motors rotate together with the DNA substrate and that the integration of both processes forms the mechanistic basis for DNA recombination by continuous branch migration. Taken together, our data decipher the molecular principles of homologous recombination by the RuvAB-HJ machinery, outline how hexameric AAA+ motors can generate mechanical force and provide a blueprint for the design of state-specific compounds targeting AAA+ motors.