A widespread class of prokaryotic motors powered by secretion motor adenosine triphosphatases (ATPases) drives the dynamic extension and retraction of extracellular fibers, such as type IV pili (T4P). Among these, the tight adherence (tad) pili are critical for surface sensing and biofilm formation. As for most other motors belonging to this class, how tad pili retract despite lacking a dedicated retraction motor ATPase has remained a mystery. Here, we find that a bifunctional pilus motor ATPase, CpaF, drives both activities through adenosine 5′-triphosphate (ATP) hydrolysis. We show that mutations within CpaF result in a correlated reduction in the rates of extension and retraction that directly scales with decreased ATP hydrolysis and retraction force. Thus, a single motor ATPase drives the bidirectional processes of pilus fiber extension and retraction.