The bacterial flagellum is a motility apparatus in which a helical filament is driven by a rotary motor. The long helical filament, which acts as a screw, is not a rigid propeller, but switches its helical form upon quick reversal of the motor rotaion. Complementary use of Xray diffraction and electron cryomicroscopy reveals the detail structure of this large complex. We describe the molecular mechanism of polymorphic supercoiling based on the structure.