The growth of the bacterial flagellar filament occurs at its distal end by self-assembly of flagellin transported from the cytoplasm through the narrow central channel of the flagellum. The cap at the growing end is essential for its growth, remaining stably attached while permitting the flagellin insertion. The structure of the cap-filament analyzed by electron cryomicroscopy suggested a cap rotation mechanism to promote the flagellin self-assembly.