Bacterial pathogens use an injectisome, also called the needle complex (NC), to deliver virulence proteins into eukaryotic host cells upon contact. The NC structure is made of an extracellular thin needle tube and a basal body consisting of multiple rings that span the inner and outer membranes and is classified as the type III secretion system (T3SS). The structure of NC is similar to that of the flagellar basal body (FBB), suggesting a close evolutionary relationship between these two molecular structures. However, it remains elusive how similar they are in situ, and the structural details of these complexes isolated from cells and visualized by electron cryomicroscopy have shown only the protein export channel and housing for the export apparatus composed of multiple transmembrane and cytoplasmic proteins. Here we report in situ structures of Salmonella NC and FBB revealed by electron cryotomography. NC does not have the large cytoplasmic ring unlike FBB although it has been predicted from the export promoting function. However, a wing-like disc and a globular density corresponding to the export gate platform and ATPase hexamer ring, respectively, are common to both, and they are stably attached to the base of NC and FBB in the cytoplasmic side through thin connectors, revealing yet unidentified common functional architectures of the two systems. The ATPase ring is too far from the gate platform to bring export substrates with chaperones to the gate, suggesting that both apparatuses are observed in an export-off state.