The type II secretion system (T2SS) is a multiprotein envelope-spanning assembly that translocates a wide range of virulence factors, enzymes and effectors through the outer membrane of many Gram-negative bacteria. Here, using electron cryotomography and subtomogram averaging methods, we reveal the in vivo structure of an intact T2SS imaged within the human pathogen Legionella pneumophila. Although the T2SS has only limited sequence and component homology with the evolutionarily related type IV pilus (T4P) system, we show that their overall architectures are remarkably similar. Despite similarities, there are also differences, including, for example, that the T2SS–ATPase complex is usually present but disengaged from the inner membrane, the T2SS has a much longer periplasmic vestibule and it has a short-lived flexible pseudopilus. Placing atomic models of the components into our electron cryotomography map produced a complete architectural model of the intact T2SS that provides insights into the structure and function of its components, its position within the cell envelope and the interactions between its different subcomplexes