Type IV pili are responsible for a diverse range of functions, including twitching motility and cell adhesion. Assembly of the pilus fiber is driven by a cytoplasmic ATPase: it interacts with an inner membrane complex of biogenesis proteins which, in turn, bind to nascent pilin subunits and mediate fiber assembly. Here we report the structural characterization of the PilF TFP assembly ATPase from Thermus thermophilus. The crystal structure of a recombinant C-terminal fragment of PilF revealed bound, unhydrolysed ATP, although the full length complex was enzymatically active. 3D reconstructions were carried out by single particle cryoelectron microscopy for full length apoprotein PilF and in complex with AMPPNP. The structure forms an hourglass-like shape, with the ATPase domains in one half and the N1 domains in the second half which, we propose, interact with the other pilus biogenesis components. Molecular models for both forms were generated: binding of AMPPNP causes an upward shift of the N1 domains towards the ATPase domains of ~8 Å. We advocate a model in which ATP hydrolysis is linked to displacement of the N1 domains which is associated with lifting pilin subunits out of the inner membrane, and provide the activation energy needed to form the pilus fiber.