A motor complex composed of an extracellular helical protein filament coupled to a rotary motor embedded in the cell envelope.