Type IV pili (T4P) are dynamic surface structures that undergo cycles of extension and retraction. T4P dynamics center on the PilB and PilT proteins, which are members of the secretion ATPase superfamily of proteins. Here, we show that PilB and PilT of the T4P system in Myxococcus xanthus have ATPase activity in vitro. Using a structure-guided approach, we systematically mutagenized PilB and PilT to resolve whether both ATP binding and hydrolysis are important for PilB and PilT function in vivo. PilB as well as PilT ATPase activity was abolished in vitro by replacement of conserved residues in the Walker A and Walker B boxes that are involved in ATP binding and hydrolysis, respectively. PilB proteins containing mutant Walker A or Walker B boxes were nonfunctional in vivo and unable to support T4P extension. PilT proteins containing mutant Walker A or Walker B boxes were also nonfunctional in vivo and unable to support T4P retraction. These data provide genetic evidence that both ATP binding and hydrolysis by PilB are essential for T4P extension and that both ATP binding and hydrolysis by PilT are essential for T4P retraction. Thus, PilB and PilT are ATPases that act at distinct steps in the T4P extension/retraction cycle in vivo.Type IV pili (T4P) are versatile, filamentous surface structures found in many gram-negative bacteria. In Myxococcus xanthus, Pseudomonas aeruginosa, and Neisseria gonorrhoeae T4P mediate surface motility (27). T4P also mediate attachment and microcolony formation by human pathogens such as Escherichia coli, N. gonorrhoeae, P. aeruginosa, and Vibrio cholerae on eukaryotic host cells (6). Moreover, T4P have important functions in biofilm formation (22,34) and DNA uptake by natural transformation (9). A hallmark of T4P compared to other filamentous surface structures is their dynamic nature; i.e., T4P undergo cycles of extension and retraction, and it is during the retraction step that a force sufficiently large to pull a bacterial cell forward is generated (29, 51, 52).T4P are thin (5-to 8-nm), flexible, helical filaments several micrometers in length, with high tensile strength (Ͼ100 pN) and typically composed only of the PilA pilin subunit (6). The protein machinery required for T4P biogenesis and function is highly conserved and encompasses 17 proteins as defined for T4P in Neisseria meningitidis (4). These proteins localize to the cytoplasm, inner membrane, periplasm, and outer membrane (35). In vitro analyses and genetic analyses of T4P in N. meningitidis suggest that these proteins interact extensively and form a transenvelope complex (4). Many of the proteins involved in T4P biogenesis and function share similarity with proteins found in type II secretion systems (T2SS) and archaeal flagellum systems (35). Several of the proteins are phylogenetically related, suggesting that the three machineries may share functional characteristics (35). Indeed, overexpression of pseudopilins from the T2SS in Klebsiella oxytoca, Xanthomonas campestris, and P. aeruginosa results in the formation of...